Closed Bug 809666 Opened 9 years ago Closed 9 years ago
.import("resource:///modules/ctypes .jsm").ctypes is undefined when jsloader .reuse Global = true
In B2G, we have set jsloader.reuseGlobal = true which means all JSMs are executed in a function scope using a shared global (see bug 798491). In this scenario, Cu.import()ing ctypes.jsm no longer exports the 'ctypes' symbol. Cu.import("resource:///modules/ctypes.jsm").ctypes is undefined. I suspect this is because the initializer  that scribbles the 'ctypes' object into the JSM scope explicitly gets the global, not the function scope. Maybe the helper proposed in bug 807845 could help here?  https://mxr.mozilla.org/mozilla-central/source/toolkit/components/ctypes/ctypes.jsm#21  https://mxr.mozilla.org/mozilla-central/source/toolkit/components/ctypes/ctypes.cpp#121
Correct on all counts.
We have to make the same changes to toolkit/components/perf too.
9 years ago
Assignee: nobody → khuey
9 years ago
Depends on: 807845
Nom'ing for basecampl. This blocks running the RIL xpcshell tests (they are not enabled yet on the infra, but developers are encouraged to run them to hunt down regressions.)
blocking-basecamp: --- → ?
Attachment #680707 - Flags: review?(mrbkap) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Unfortunately, this fails to build on Aurora. Backed out. https://hg.mozilla.org/releases/mozilla-aurora/rev/133dfa6f8039 https://tbpl.mozilla.org/php/getParsedLog.php?id=17009985&tree=Mozilla-Aurora ctypes.cpp e:/builds/moz2_slave/m-aurora-w32/build/toolkit/components/ctypes/ctypes.cpp(126) : error C2039: 'Get' : is not a member of 'mozJSComponentLoader' e:\builds\moz2_slave\m-aurora-w32\build\js\xpconnect\loader\mozJSComponentLoader.h(37) : see declaration of 'mozJSComponentLoader' e:/builds/moz2_slave/m-aurora-w32/build/toolkit/components/ctypes/ctypes.cpp(126) : error C3861: 'Get': identifier not found e:/builds/moz2_slave/m-aurora-w32/build/toolkit/components/ctypes/ctypes.cpp(127) : error C2039: 'FindTargetObject' : is not a member of 'mozJSComponentLoader' e:\builds\moz2_slave\m-aurora-w32\build\js\xpconnect\loader\mozJSComponentLoader.h(37) : see declaration of 'mozJSComponentLoader'
https://hg.mozilla.org/releases/mozilla-aurora/rev/341b2b3db621 It needed the patch in Bug 810987.
+ bool reusingGlobal = Preferences::GetBool("jsloader.reuseGlobal"); Where is this variable used?
(In reply to Masatoshi Kimura [:emk] from comment #11) > + bool reusingGlobal = Preferences::GetBool("jsloader.reuseGlobal"); > Where is this variable used? (It's not. I filed bug 825467 w/ a patch to drop it.)
You need to log in before you can comment on or make changes to this bug.