Open
Bug 760095
Opened 12 years ago
Updated 2 years ago
Move canonical standard class objects from slots on the global to members of the Realm
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: bzbarsky, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [js:p2])
Right now user code that wants to add a slot to both globals and non-globals has to use different slot indices, so has to branch every time it wants to use the slot. This is at least biting Paris bindings.
Jason suggested that globals should work like functions: some small number of slots at the front are reserved for API consumers, then come the slots the engine uses on globals, and if you want more than the pre-reserved number of slots, they go after the engine slots.
In fact, XPConnect is already depending on the fact that the JS engine never uses slot 0 on globals (because it's the original constructor slot for the "Null" class).
Doing this would, of course, require hunting down all the places in the engine where we touch the global's slots and adding this compile-time offset to them all... But past that, there should be no slowdown; just a slight bit more memory usage per global.
Comment 1•12 years ago
|
||
Once the change underlying bug 755186 is fixed, I think we can just make globals not need pre-reserved global slots, in which case global classes could just use the normal JSCLASS_HAS_RESERVED_SLOTS(n) mechanism.
Updated•12 years ago
|
Whiteboard: [js:p2]
Updated•11 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Version: unspecified → Trunk
Reporter | ||
Updated•11 years ago
|
Summary: Globals should pre-reserve some user slots at the start, like functions do → Move canonical standard class objects from slots on the global to members of the compartment
Reporter | ||
Comment 2•11 years ago
|
||
New summary is what I think Jeff and I decided we should do.
Updated•11 years ago
|
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Reporter | ||
Updated•6 years ago
|
Summary: Move canonical standard class objects from slots on the global to members of the compartment → Move canonical standard class objects from slots on the global to members of the Realm
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•