Bug 907508 - Drop the number of slots on XPConnect globals from 2 to 1. r=bz

In the old world, XPConnect globals had one reserved slot, which was used to
store a private pointer to the XPCWrappedNativeScope.

Then, in the new DOM bindings landing (bug 740069), we added two slots, one
for DOM_GLOBAL_OBJECT_SLOT, and one for DOM_PROTOTYPE_SLOT.

Then, in bug 761707, we removed DOM_GLOBAL_OBJECT_SLOT, but the slot count
remained at 3.

Then, in bug 797821, we stopped storing the XPCWrappedNativeScope in the slot
on the global, and dropped the XPConnect global count from 3 to 2.

Given the above, we can safely drop it to 1, here. It's easy to check that
this is correct, because reserved slots for globals have a different offset,
which is JSCLASS_GLOBAL_SLOT_COUNT. And according to mxr, the only thing
defined in terms of that is DOM_PROTOTYPE_SLOT (which takes the same value).
This means that all subsequent slots on the global are unused.
This commit is contained in:
Bobby Holley 2013-08-20 21:21:00 -07:00
parent ea15ca7cf7
commit 137154e93e

View File

@ -79,7 +79,7 @@ struct RuntimeStats;
#define XPCONNECT_GLOBAL_FLAGS \
JSCLASS_DOM_GLOBAL | JSCLASS_HAS_PRIVATE | \
JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_IMPLEMENTS_BARRIERS | \
JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(2)
JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(1)
void
TraceXPCGlobal(JSTracer *trc, JSObject *obj);