After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 690982 - gjs: port to spidermonkey js188/esr17
gjs: port to spidermonkey js188/esr17
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
1.35.x
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on: 692565
Blocks:
 
 
Reported: 2013-01-02 04:55 UTC by darkxst
Modified: 2013-08-21 07:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libname patch (4.41 KB, patch)
2013-01-02 05:00 UTC, darkxst
none Details | Review
filter-out %.$(LIBS_DESC_SUFFIX) (1.32 KB, patch)
2013-01-02 05:01 UTC, darkxst
none Details | Review
remove unused and obsolete flag. (4.76 KB, patch)
2013-01-02 21:29 UTC, darkxst
accepted-commit_now Details | Review
more typedef changes for types that have been removed from esr17 (2.24 KB, patch)
2013-01-03 01:24 UTC, darkxst
reviewed Details | Review
api change to JS_NumberValue (13.82 KB, patch)
2013-01-03 03:21 UTC, darkxst
none Details | Review
remove unused and obsolete flag. (4.69 KB, patch)
2013-01-03 21:45 UTC, darkxst
committed Details | Review
[PATCH 1/2] byteArray (2.36 KB, patch)
2013-01-03 21:47 UTC, darkxst
none Details | Review
bytearray: correct new resolve behaviour (3.18 KB, patch)
2013-01-03 21:47 UTC, darkxst
none Details | Review
byteArray: Remove prototype checks from func implementations (2.17 KB, patch)
2013-01-03 21:50 UTC, darkxst
rejected Details | Review
bytearray: correct new resolve behaviour (3.03 KB, patch)
2013-01-03 21:51 UTC, darkxst
rejected Details | Review
byteArray: Remove prototype checks from func implementations (3.04 KB, patch)
2013-01-03 22:31 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
byteArray: Do not use JSCLASS_NEW_RESOLVE_GETS_START (2.75 KB, patch)
2013-01-03 22:31 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
byteArray: Clean up resolve op (1.54 KB, patch)
2013-01-03 22:31 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Don't use depreciated types (2.39 KB, patch)
2013-01-03 22:43 UTC, darkxst
committed Details | Review
JS_BufferIsCompilableUnit API change (947 bytes, patch)
2013-01-09 22:49 UTC, darkxst
none Details | Review
api change to JS_NumberValue (14.06 KB, patch)
2013-01-09 22:49 UTC, darkxst
needs-work Details | Review
change build version to mozjs188 (1.73 KB, patch)
2013-01-09 22:49 UTC, darkxst
none Details | Review
define JSVAL_IS_OBJECT (847 bytes, patch)
2013-01-09 22:49 UTC, darkxst
none Details | Review
JS_GetClass remove context argument (9.14 KB, patch)
2013-01-09 22:49 UTC, darkxst
none Details | Review
JS_SetPrivate/GetPrivate no longer require context argument (17.47 KB, patch)
2013-01-09 22:49 UTC, darkxst
needs-work Details | Review
JSCLass callbacks now use JSHandleObject/Id types (28.11 KB, patch)
2013-01-09 22:49 UTC, darkxst
none Details | Review
testBoxed: add test for getter (704 bytes, patch)
2013-01-09 22:49 UTC, darkxst
none Details | Review
update for JSClass prototype changes (4.06 KB, patch)
2013-01-09 22:49 UTC, darkxst
none Details | Review
Misc API changes (5.37 KB, patch)
2013-01-09 22:50 UTC, darkxst
none Details | Review
byteArray: update PropertySpec for new API (943 bytes, patch)
2013-01-09 22:50 UTC, darkxst
none Details | Review
JS_BufferIsCompilableUnit API change (947 bytes, patch)
2013-01-12 00:26 UTC, darkxst
none Details | Review
change build version to mozjs188 (1.73 KB, patch)
2013-01-12 00:26 UTC, darkxst
none Details | Review
JS_GetClass remove context argument (9.12 KB, patch)
2013-01-12 00:26 UTC, darkxst
none Details | Review
JS_SetPrivate/GetPrivate no longer require context argument (17.47 KB, patch)
2013-01-12 00:26 UTC, darkxst
none Details | Review
JSCLass callbacks now use JSHandleObject/Id types (28.11 KB, patch)
2013-01-12 00:26 UTC, darkxst
none Details | Review
testBoxed: add test for getter (704 bytes, patch)
2013-01-12 00:26 UTC, darkxst
committed Details | Review
update for JSClass prototype changes (4.06 KB, patch)
2013-01-12 00:26 UTC, darkxst
none Details | Review
Misc API changes (3.60 KB, patch)
2013-01-12 00:26 UTC, darkxst
none Details | Review
byteArray: update PropertySpec for new API (943 bytes, patch)
2013-01-12 00:27 UTC, darkxst
none Details | Review
temporarily disable two failing tests (927 bytes, patch)
2013-01-12 00:27 UTC, darkxst
none Details | Review
Add wrappers for removed api, JS_NewNumberValue and JSVAL_IS_OBJECT() (964 bytes, patch)
2013-01-12 00:27 UTC, darkxst
none Details | Review
Replace context with runtime in GC Functions/Callback. (3.26 KB, patch)
2013-01-12 00:27 UTC, darkxst
none Details | Review
I don't have git access but here is the split off patch. (777 bytes, patch)
2013-01-14 02:11 UTC, darkxst
committed Details | Review

Description darkxst 2013-01-02 04:55:26 UTC
Just for kicks I tried to build gjs against the spidermonkey engine from Firefox 17ESR. Hoping to see if it might fix some of the JS leaks.

Building spidermonkey from mercurial repos itself was rather trivial, there really is only one patch required to get a standalone version. Potentially this is something that could be done with jhbuild (except it requires autoconf2.13 to build configure script)?.

There are however a lot of API changes in the 17ESR engine, here are a few that I have noticed so far. In particular I have no idea how to fix the removal of the JSCLASS_NEW_RESOLVE_GETS_START() flag.

- Many typedefs have been removed. https://developer.mozilla.org/en-US/docs/SpiderMonkey/1.8.8#typedef_Changes


- JSVAL_IS_OBJECT() has been removed. Instead use !JSVAL_IS_PRIMITIVE(v) to detect objects and JSVAL_IS_NULL(v) to detect null.

- JSCLASS_NEW_RESOLVE_GETS_START() is removed

- JS_SetPrivate(), JS_GetClass and a lot of other methods no longer takes context as 1st argument.

- JS_NewCompartmentAndGlobalObject() is removed, Use JS_NewGlobalObject() instead.

- JS_NewNumberValue appears to be changed to a static method JS_NumberValue(double)

- JS_GC() epects runtime as argument instead of context.
Comment 1 darkxst 2013-01-02 05:00:05 UTC
Created attachment 232499 [details] [review]
libname patch

this patch is against the 17.0-1 RELEASE snapshot https://hg.mozilla.org/releases/mozilla-esr17/file/d8475f8bd98f
Comment 2 darkxst 2013-01-02 05:01:25 UTC
Created attachment 232501 [details] [review]
filter-out %.$(LIBS_DESC_SUFFIX)

this fixes an error in the install script (although there is still the issues of public headers from js/src/dist/include not getting installed)
Comment 3 Giovanni Campagna 2013-01-02 16:49:30 UTC
Thank you for your work!
The API changes seem trivial. You can safely forget about NEW_RESOLVE_GETS_START, nothing in gjs uses the start value.
Comment 4 darkxst 2013-01-02 21:29:51 UTC
Created attachment 232579 [details] [review]
remove unused and obsolete flag.

JSCLASS_NEW_RESOLVE_GETS_START has been removed in esr17,
additionally gjs does not use the start value.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-01-02 21:32:22 UTC
Review of attachment 232579 [details] [review]:

OK
Comment 6 darkxst 2013-01-02 21:40:23 UTC
js/byteArray test is failing after the removal of JSCLASS_NEW_RESOLVE_GETS_START flag ;(
Comment 7 Giovanni Campagna 2013-01-02 22:02:26 UTC
(In reply to comment #6)
> js/byteArray test is failing after the removal of
> JSCLASS_NEW_RESOLVE_GETS_START flag ;(

byte_array_new_resolve is wrong in what is doing. *objp == obj in all interesting cases, because we ignore property resolves on the prototype (they wouldn't make sense anyway), so it should call priv_from_js(context, obj), and stop assuming that *objp is already set. Especially when it returns true without defining a property (which upsets the JS engine a lot).
Comment 8 darkxst 2013-01-03 01:24:09 UTC
Created attachment 232600 [details] [review]
more typedef changes for types that have been removed from esr17
Comment 9 darkxst 2013-01-03 03:21:10 UTC
Created attachment 232603 [details] [review]
api change to JS_NumberValue

JS_NewNumberValue is depreciated and removed in js188
Comment 10 darkxst 2013-01-03 21:45:37 UTC
Created attachment 232680 [details] [review]
remove unused and obsolete flag.

JSCLASS_NEW_RESOLVE_GETS_START has been removed in esr17,
additionally gjs does not use the start value.
Comment 11 darkxst 2013-01-03 21:47:04 UTC
Created attachment 232681 [details] [review]
[PATCH 1/2] byteArray

[PATCH 1/2] byteArray: Remove prototype checks from func
 implementations

As we don't use JSCLASS_CONSTRUCT_PROTOTYPE anymore, we don't
have a private on the prototype, and thus we can simply quit
early here.
Comment 12 darkxst 2013-01-03 21:47:50 UTC
Created attachment 232682 [details] [review]
bytearray: correct new resolve behaviour
Comment 13 darkxst 2013-01-03 21:50:32 UTC
Created attachment 232683 [details] [review]
byteArray: Remove prototype checks from func implementations

As we don't use JSCLASS_CONSTRUCT_PROTOTYPE anymore, we don't
have a private on the prototype, and thus we can simply quit
early here.
Comment 14 darkxst 2013-01-03 21:51:00 UTC
Created attachment 232684 [details] [review]
bytearray: correct new resolve behaviour
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-01-03 22:18:59 UTC
Review of attachment 232600 [details] [review]:

Needs a better commit message and a small whitespace fix, otherwise fine.

::: gjs/profiler.c
@@ +49,2 @@
     GjsProfileData *last_function_entered; /* weak ref to by_file */
+    int64_t           last_function_exit_time;

Not aligned.
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-01-03 22:19:26 UTC
Review of attachment 232683 [details] [review]:

I'll upload a better version of this.
Comment 17 Jasper St. Pierre (not reading bugmail) 2013-01-03 22:19:36 UTC
Review of attachment 232684 [details] [review]:

This one too.
Comment 18 Jasper St. Pierre (not reading bugmail) 2013-01-03 22:31:02 UTC
Created attachment 232688 [details] [review]
byteArray: Remove prototype checks from func implementations

As we don't use JSCLASS_CONSTRUCT_PROTOTYPE anymore, we don't
have a private on the prototype, which means that all instances
of a NULL priv are the prototype. As far as I can tell, the
"wrong class" case is impossible, as all of these functions
are only installed on an object with a JSClass of ByteArray.
Comment 19 Jasper St. Pierre (not reading bugmail) 2013-01-03 22:31:05 UTC
Created attachment 232689 [details] [review]
byteArray: Do not use JSCLASS_NEW_RESOLVE_GETS_START

It is a flag that has been removed in recent versions of libmozjs,
and is not something that we should depend on. This is a simple case
that tries to emulate the behavior of JSCLASS_NEW_RESOLVE_GETS_START;
a future code cleanup will simplify code here more.
Comment 20 Jasper St. Pierre (not reading bugmail) 2013-01-03 22:31:08 UTC
Created attachment 232690 [details] [review]
byteArray: Clean up resolve op

Only set the *objp value after success, leaving it at NULL
otherwise.
Comment 21 darkxst 2013-01-03 22:43:32 UTC
Created attachment 232691 [details] [review]
Don't use depreciated types

Mozilla have removed jsdouble and int64 from js188, these are
replaced with double and int64_t respectively. These changes
are safe on js185 however.
Comment 22 Jasper St. Pierre (not reading bugmail) 2013-01-03 22:46:08 UTC
Review of attachment 232691 [details] [review]:

"deprecated", and OK
Comment 23 Rico Tzschichholz 2013-01-04 09:48:40 UTC
Review of attachment 232691 [details] [review]:

commit 6c3b08843bf1bffb41666c6330b9dd3e43b817e0
Author: Tim Lunn <tim@feathertop.org>
Date:   Thu Jan 3 12:20:09 2013 +1100

    Don't use deprecated types
    
    Mozilla have removed jsdouble and int64 from js188, these are
    replaced with double and int64_t respectively. These changes
    are safe on js185 however.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690982
Comment 24 darkxst 2013-01-06 23:09:51 UTC
Another API change is the introduction of these new types

typedef struct { JSObject **_; } JSHandleObject;
typedef struct { jsid *_; } JSHandleId;

this change affects basically all callbacks, such as
(* JSPropertyOp)(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHandleValue vp);

Although I am not sure how to handle this change in a 'nice' way.
Comment 25 Colin Walters 2013-01-07 19:19:04 UTC
Review of attachment 232689 [details] [review]:

I only vaguely understand this, to be honest.  But I think it looks OK if you squash the second patch with this one; this patch on its own seems like it'd be buggy.
Comment 26 Colin Walters 2013-01-07 19:19:16 UTC
Review of attachment 232690 [details] [review]:

To be squashed
Comment 27 Colin Walters 2013-01-07 19:30:43 UTC
Review of attachment 232688 [details] [review]:

Sounds right.
Comment 28 Colin Walters 2013-01-08 16:05:33 UTC
Review of attachment 232689 [details] [review]:

We discussed this on IRC, the patches look fine separately too.
Comment 29 Colin Walters 2013-01-08 16:05:47 UTC
Review of attachment 232690 [details] [review]:

Or not squashed.
Comment 30 Jasper St. Pierre (not reading bugmail) 2013-01-08 16:49:06 UTC
Attachment 232688 [details] pushed as cd83eff - byteArray: Remove prototype checks from func implementations
Attachment 232689 [details] pushed as 27ccb39 - byteArray: Do not use JSCLASS_NEW_RESOLVE_GETS_START
Attachment 232690 [details] pushed as 56b8b71 - byteArray: Clean up resolve op
Comment 31 Rico Tzschichholz 2013-01-08 18:17:50 UTC
Review of attachment 232680 [details] [review]:

commit 947e260a0f6a60cad10811eddeddaa0f3ca22450
Author: Tim Lunn <tim@feathertop.org>
Date:   Fri Jan 4 08:01:21 2013 +1100

    remove unused and obsolete flag.
    
    JSCLASS_NEW_RESOLVE_GETS_START has been removed in esr17,
    additionally gjs does not use the start value.
Comment 32 darkxst 2013-01-09 22:49:30 UTC
Created attachment 233117 [details] [review]
JS_BufferIsCompilableUnit API change
Comment 33 darkxst 2013-01-09 22:49:34 UTC
Created attachment 233118 [details] [review]
api change to JS_NumberValue

JS_NewNumberValue is depreciated and removed in js188
Comment 34 darkxst 2013-01-09 22:49:37 UTC
Created attachment 233119 [details] [review]
change build version to mozjs188
Comment 35 darkxst 2013-01-09 22:49:40 UTC
Created attachment 233120 [details] [review]
define JSVAL_IS_OBJECT

JSVAL_IS_OBJECT has been removed, for now just redefine it in compat.h
Comment 36 darkxst 2013-01-09 22:49:44 UTC
Created attachment 233121 [details] [review]
JS_GetClass remove context argument

JS_GetClass no longer takes *context as first argument,
consequently the JS_GET_CLASS Macro is also removed.
Comment 37 darkxst 2013-01-09 22:49:47 UTC
Created attachment 233122 [details] [review]
JS_SetPrivate/GetPrivate no longer require context argument
Comment 38 darkxst 2013-01-09 22:49:50 UTC
Created attachment 233123 [details] [review]
JSCLass callbacks now use JSHandleObject/Id types

All functions which are callbacks for JSClass, now have new types
which wraps the Objects in an extra pointer. We need to cast and
then derefence these objects.
Comment 39 darkxst 2013-01-09 22:49:54 UTC
Created attachment 233124 [details] [review]
testBoxed: add test for getter
Comment 40 darkxst 2013-01-09 22:49:57 UTC
Created attachment 233125 [details] [review]
update for JSClass prototype changes
Comment 41 darkxst 2013-01-09 22:50:00 UTC
Created attachment 233126 [details] [review]
Misc API changes

Enable E4X, GC functions take runtime, remove non-public header and
some deprecated API.
Comment 42 darkxst 2013-01-09 22:50:03 UTC
Created attachment 233127 [details] [review]
byteArray: update PropertySpec for new API

For some reason the setter fails to get called when JSPROP_SHARED
is set.
Comment 43 Jasper St. Pierre (not reading bugmail) 2013-01-09 22:53:38 UTC
Review of attachment 233118 [details] [review]:

So, while I don't want to have build hell, until js188 has an official tarball, I don't want to approve this. This seems like a very wrappable change, so how do you feel about a HAVE_JS_NEWNUMBERVALUE, and a JS_NewNumberValue wrapper in compat.h?
Comment 44 Jasper St. Pierre (not reading bugmail) 2013-01-09 22:55:00 UTC
Review of attachment 233122 [details] [review]:

::: gi/boxed.c
@@ +450,3 @@
                         object, priv);
 
+    proto = JS_GetPrototype(object);

Mention the GetPrototype changes in the commit message, please.
Comment 45 darkxst 2013-01-09 23:31:28 UTC
(In reply to comment #43)
> Review of attachment 233118 [details] [review]:
> 
> So, while I don't want to have build hell, until js188 has an official tarball,
> I don't want to approve this. This seems like a very wrappable change, so how
> do you feel about a HAVE_JS_NEWNUMBERVALUE, and a JS_NewNumberValue wrapper in
> compat.h?

Sure, will do.
Comment 46 darkxst 2013-01-12 00:26:13 UTC
Created attachment 233270 [details] [review]
JS_BufferIsCompilableUnit API change
Comment 47 darkxst 2013-01-12 00:26:25 UTC
Created attachment 233271 [details] [review]
change build version to mozjs188
Comment 48 darkxst 2013-01-12 00:26:32 UTC
Created attachment 233272 [details] [review]
JS_GetClass remove context argument

JS_GetClass no longer takes *context as first argument,
consequently the JS_GET_CLASS Macro is also removed.
Comment 49 darkxst 2013-01-12 00:26:38 UTC
Created attachment 233273 [details] [review]
JS_SetPrivate/GetPrivate no longer require context argument
Comment 50 darkxst 2013-01-12 00:26:43 UTC
Created attachment 233274 [details] [review]
JSCLass callbacks now use JSHandleObject/Id types

All functions which are callbacks for JSClass, now have new types
which wraps the Objects in an extra pointer. We need to cast and
then derefence these objects.
Comment 51 darkxst 2013-01-12 00:26:48 UTC
Created attachment 233275 [details] [review]
testBoxed: add test for getter
Comment 52 darkxst 2013-01-12 00:26:52 UTC
Created attachment 233276 [details] [review]
update for JSClass prototype changes
Comment 53 darkxst 2013-01-12 00:26:57 UTC
Created attachment 233277 [details] [review]
Misc API changes

Enable E4X, remove non-public header and
some deprecated API.
Comment 54 darkxst 2013-01-12 00:27:07 UTC
Created attachment 233278 [details] [review]
byteArray: update PropertySpec for new API

For some reason the setter fails to get called when JSPROP_SHARED
is set.
Comment 55 darkxst 2013-01-12 00:27:13 UTC
Created attachment 233279 [details] [review]
temporarily disable two failing tests
Comment 56 darkxst 2013-01-12 00:27:25 UTC
Created attachment 233280 [details] [review]
Add wrappers for removed api, JS_NewNumberValue and JSVAL_IS_OBJECT()
Comment 57 darkxst 2013-01-12 00:27:33 UTC
Created attachment 233281 [details] [review]
Replace context with runtime in GC Functions/Callback.
Comment 58 darkxst 2013-01-12 00:32:09 UTC
Gnome-shell is now running stable and with no obvious issues on js188.
Comment 59 Jasper St. Pierre (not reading bugmail) 2013-01-12 00:34:57 UTC
Review of attachment 233275 [details] [review]:

OK.
Comment 60 Jasper St. Pierre (not reading bugmail) 2013-01-12 07:34:13 UTC
Review of attachment 233277 [details] [review]:

::: modules/jsUnit.js
@@ +451,3 @@
 // calls to setUp() and tearDown()
 function gjstestRun(window_, setUp, tearDown) {
+  var propName;

Split this fix off and push it please.
Comment 61 darkxst 2013-01-14 02:11:08 UTC
Created attachment 233409 [details] [review]
I don't have git access but here is the split off patch.

Fix assignment to undeclared variable warning.
Comment 62 darkxst 2013-01-14 02:17:32 UTC
After a few days of testing this, I can report:

- I haven't seen a single GC deadlock! Even with GC on idle re-enabled.
- Memory usage is dramatically lower (w/ GC on idle). I am on ~180MB after 48hrs, previously that would have been atleast 400+MB (although it has been a while since I g-s has actually run that long, due to GC deadlocks).
- Most of the leaks in mozjs appear to be gone.
Comment 63 Rico Tzschichholz 2013-01-19 13:03:10 UTC
Review of attachment 233409 [details] [review]:

commit 20971324011b2504b715ee671bc541eb974ffb08
Author: Tim Lunn <tim@feathertop.org>
Date:   Mon Jan 14 13:09:21 2013 +1100

    Fix assignment to undeclared variable warning.
Comment 64 Rico Tzschichholz 2013-01-19 13:07:56 UTC
Review of attachment 233275 [details] [review]:

commit d03c9ab24eeb67390005d0d8d2daf16639dacf6a
Author: Tim Lunn <tim@feathertop.org>
Date:   Tue Jan 8 07:51:05 2013 +1100

    testBoxed: add test for getter
Comment 65 Colin Walters 2013-01-23 21:55:21 UTC
I pushed a lot of these patches to:

http://git.gnome.org/browse/gjs/log/?h=wip/mozjs-188

Let's start iterating from there.  The only patch that didn't apply is:
http://bugzilla-attachments.gnome.org/attachment.cgi?id=233276
Comment 66 darkxst 2013-01-23 23:34:33 UTC
I have created a repo on github with all patches applied and some updated commit messages.

https://github.com/darkxst/gjs-js188

As far as gjs is concerned this is mostly complete, I have not seen any issues. There are some compiler warnings however that could be silenced by casting callbacks in class declarations etc.

Additionally polkit might need some attention, I think the only api change that appears to affect it is the type changes, however I had to jump through some hoops to get it building due to the dl_open() stuff.
Comment 67 Maciej (Matthew) Piechotka 2013-01-30 09:11:34 UTC
When I tried to compile the branch I got:

libtool: compile:  x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -pthread -I/usr/include/gobject-introspection-1.0 -I/usr/lib64/libffi-3.0.11/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/js -I/usr/include/nspr 
-DGJS_TOP_SRCDIR=\".\" -DGJS_JS_DIR=\"/usr/share/gjs-1.0\" -DGJS_NATIVE_DIR=\"/usr/lib64/gjs-1.0\" -DPKGLIBDIR=\"/usr/lib64/gjs\" -I./gi -DGJS_COMPILATION -Wall
 -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare -O2 -march=native -pipe -ggdb -w -Wa,--compress-debug-sections -c gi/boxed.c  -fPIC -DPIC -o .libs/libgjs_la-boxed.o
gi/boxed.c: In function 'get_nested_interface_object':
gi/boxed.c:623:24: error: incompatible type for argument 3 of 'JS_SetReservedSlot'
/usr/include/js/jsapi.h:4822:1: note: expected 'jsval' but argument is of type 'int'
gi/boxed.c:623:24: error: too many arguments to function 'JS_SetReservedSlot'/usr/include/js/jsapi.h:4822:1: note: declared here
Comment 68 darkxst 2013-01-30 19:59:24 UTC
Maciej, which branch? the wip branch is still missing a patch, however the github one should work.
Comment 69 Maciej (Matthew) Piechotka 2013-01-30 21:17:21 UTC
(In reply to comment #68)
> Maciej, which branch? the wip branch is still missing a patch, however the
> github one should work.

github one built but gnome-shell (3.6 as I'm trying to use it on 'production' system which crashes every few hours due to bug #688197) rebuilt against new version failed:

    JS ERROR: !!!   Exception was: Error: No JS module 'dbus' found in search path
    JS ERROR: !!!     message = '"No JS module 'dbus' found in search path"'
    JS ERROR: !!!     fileName = '"/usr/share/gnome-shell/js/ui/keyboard.js"'
    JS ERROR: !!!     lineNumber = '5'
    JS ERROR: !!!     stack = '"@/usr/share/gnome-shell/js/ui/keyboard.js:5
@/usr/share/gnome-shell/js/ui/main.js:19
@<main>:1
"'
Comment 70 Giovanni Campagna 2013-01-30 21:27:33 UTC
That's a completely unrelated error, and it's an incompatibility of gnome-shell 3.6 with gjs master.
You can fix it fast by removing the imports.dbus line from /usr/share/gnome-shell/js/ui/main.js (it doesn't really use that module, it's a left over import)
Comment 71 darkxst 2013-01-31 04:05:39 UTC
Indeed I have not tried building 3.6 against the new js188/gjs stack, but would be interested to hear if it works out.
Comment 72 Maciej (Matthew) Piechotka 2013-01-31 10:04:08 UTC
Sorry - I didn't wanted to spam the list but it looks like modifying keyboard.js everything works fine (however I haven't check the reproduction of bug yet). I've updated only glib, gir, spidermonkey and gjs.
Comment 73 darkxst 2013-02-10 23:42:19 UTC
Spidermonkey release should be coming fairly soon, there is a meta bug here tracking the patches that need to land first https://bugzilla.mozilla.org/show_bug.cgi?id=837921

I have a snapshot with most of these patches applied here https://github.com/darkxst/js17

gjs: the patchset here is basically complete and working, although the build version patch will need to be updated to use the new library naming (libmozjs-17.0). 

I also patched polkit to work with the esr17 spidermonkey, and submitted upstream these 2 bugs:
https://bugs.freedesktop.org/show_bug.cgi?id=59830
https://bugs.freedesktop.org/show_bug.cgi?id=59781
Comment 74 Colin Walters 2013-02-26 20:33:22 UTC
At a high level what I fear with this is that particularly now that polkit requires mozjs, we're going to create major headaches for distributors.

At least in Fedora for example, many things link to mozjs185.  Stuff like libproxy, that is installed by default there.  Now we don't of course need to port everything at once, and there's going to be some overlap time where there are 2 versions.

One option is to create a medium term branch (we'd have to debate which is master) for the life of one GNOME release cycle.

The other option of course is #ifdef but I suspect that'd be rather horrible.

Does Ubuntu have any plans wrt this?
Comment 75 darkxst 2013-02-26 21:39:25 UTC
I think polkit would be easy enough to handle with ifdef's. For gjs branching is really the only option.

Ubuntu will be shipping both mozjs versions, since there are a bunch of rdepends (outside of GNOME) that aren’t likely to be ported in a hurry.
Comment 76 Colin Walters 2013-03-10 21:35:42 UTC
I've pushed a rebased version of these patches to:

https://git.gnome.org/browse/gjs/log/?h=wip/js17

Let's make that branch the canonical one?
Comment 77 Colin Walters 2013-03-26 22:17:54 UTC
Ok, I've merged this as:

https://git.gnome.org/browse/gjs/log/?h=gnome-3-8-js17

And now I'm going to merge the changes to master.
Comment 78 Chad Rodrigue 2013-03-27 20:01:56 UTC
...does this mean that 3.8 in Ubuntu 13.04 will ship with Mozjs17 by default?  There's sort of a huge memory leak issue depending on it.
Comment 79 darkxst 2013-04-04 09:31:29 UTC
Chad, its in gnome3-staging ppa now, will get moved into normal gnome3 ppa after a bit more testing. Had hoped to get it into the Raring archives, but everything happened far to late for that to probably be possible.
Comment 80 Chad Rodrigue 2013-04-05 14:13:27 UTC
That's cool.  It's in *a* PPA that I can test and use.  Thanx a ton!
Comment 81 Chad Rodrigue 2013-04-05 15:33:32 UTC
I see it in the Gnome-Shell PPA.  Question: does this build enable GC on idle?  It starts G-S with *much* lower initial memory usage, but I'm still having the memory-creep-with-opening/closing-lotsa-windows issue on this build.
Comment 82 darkxst 2013-04-06 02:03:37 UTC
Yes it has the GC on idle re-enabled. 
I don't think anything has been done about the window clones leak issues
Comment 83 Jasper St. Pierre (not reading bugmail) 2013-04-06 02:12:54 UTC
It has? Where?
Comment 84 darkxst 2013-04-06 02:16:13 UTC
Jasper, on the Gnome3 PPA, since we are running the new spidermonkey there.
Comment 85 Evgeny Bobkin 2013-08-21 07:08:52 UTC
It seems that this post is a huge success story for 3.8, at least on gentoo :-) https://bugs.gentoo.org/show_bug.cgi?id=480752#c4