Closed
Bug 604813
Opened 14 years ago
Closed 10 years ago
Eliminate cx->globalObject
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 981218
Tracking | Status | |
---|---|---|
status2.0 | --- | wanted |
People
(Reporter: gal, Assigned: gal)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
patch
|
Details | Diff | Splinter Review |
This patch eliminates cx->globalObject and makes JSAutoRequest take a scope object (usually a global object), which becomes the default global and we also switch to that scope object's compartment.
This modifies the signature of JS_BeginRequest, and eliminates JS_Set/GetGlobalObject.
Shell starts up.
Assignee | ||
Comment 1•14 years ago
|
||
Assignee: general → gal
Comment 2•14 years ago
|
||
Hooray!
Comment 3•14 years ago
|
||
(In reply to comment #0)
> This modifies the signature of JS_BeginRequest, and eliminates
> JS_Set/GetGlobalObject.
The changes will be hard to swallow for embeddings that uses JS_BeginRequest as they now will need to check for the return result of JS_BeginRequest.
Another observation is that this introduces a stack of requests. IIRC few places in Firefox code still violates that with code like BeginRequest(cx1) BeginRequest(cx2) EndRequest(cx1) EndRequest(cx2)
So perhaps as an alternative to changes here what about simply patching API that leads to the need to access the global object with an explicit global scope parameter? For example, if the callers of js_GetClassPrototype would be patched to ensure that they always pass non-null global object, it would eliminate most if not all needs for ::globalObject.
Assignee | ||
Comment 4•14 years ago
|
||
Yeah, I have been playing around with several approaches. The fix for #2 is to delete that code. We can't be bogged down by horrible API abuses in Firefox code. That code has to die. Fortunately, I have only seen a handful of uses of Begin/End request. Most of Gecko uses JSAutoRequest already.
Assignee | ||
Updated•14 years ago
|
Blocks: compartmentGC
Updated•14 years ago
|
blocking2.0: --- → beta8+
Updated•14 years ago
|
blocking2.0: beta8+ → beta9+
Assignee | ||
Comment 5•14 years ago
|
||
No longer have to block on this. We will force all threads to synchronize even if we only GC a single compartment.
Assignee | ||
Updated•14 years ago
|
No longer blocks: compartmentGC
Updated•14 years ago
|
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•