Bug 1010658 part 2. Stop storing a DOMClass* in a slot on DOM prototypes. r=peterv

This commit is contained in:
Boris Zbarsky 2014-05-19 16:37:59 -04:00
parent 57472f29b6
commit e32f492a47
4 changed files with 6 additions and 20 deletions

View File

@ -640,7 +640,7 @@ CreateInterfaceObjects(JSContext* cx, JS::Handle<JSObject*> global,
JS::Handle<JSObject*> constructorProto,
const JSClass* constructorClass, const JSNativeHolder* constructor,
unsigned ctorNargs, const NamedConstructor* namedConstructors,
JS::Heap<JSObject*>* constructorCache, const DOMClass* domClass,
JS::Heap<JSObject*>* constructorCache,
const NativeProperties* properties,
const NativeProperties* chromeOnlyProperties,
const char* name, bool defineOnGlobal)
@ -679,9 +679,6 @@ CreateInterfaceObjects(JSContext* cx, JS::Handle<JSObject*> global,
return;
}
js::SetReservedSlot(proto, DOM_PROTO_INSTANCE_CLASS_SLOT,
JS::PrivateValue(const_cast<DOMClass*>(domClass)));
*protoCache = proto;
}
else {

View File

@ -573,8 +573,6 @@ struct NamedConstructor
* constructorCache a pointer to a JSObject pointer where we should cache the
* interface object. This must be null if both constructorClass
* and constructor are null, and non-null otherwise.
* domClass is the DOMClass of instance objects for this class. This can be
* null if this is not a concrete proto.
* properties contains the methods, attributes and constants to be defined on
* objects in any compartment.
* chromeProperties contains the methods, attributes and constants to be defined
@ -600,7 +598,7 @@ CreateInterfaceObjects(JSContext* cx, JS::Handle<JSObject*> global,
JS::Handle<JSObject*> interfaceProto,
const JSClass* constructorClass, const JSNativeHolder* constructor,
unsigned ctorNargs, const NamedConstructor* namedConstructors,
JS::Heap<JSObject*>* constructorCache, const DOMClass* domClass,
JS::Heap<JSObject*>* constructorCache,
const NativeProperties* regularProperties,
const NativeProperties* chromeOnlyProperties,
const char* name, bool defineOnGlobal);

View File

@ -2476,11 +2476,6 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
interfaceClass = "nullptr"
interfaceCache = "nullptr"
if self.descriptor.concrete:
domClass = "&Class.mClass"
else:
domClass = "nullptr"
isGlobal = self.descriptor.interface.getExtendedAttribute("Global") is not None
if not isGlobal and self.properties.hasNonChromeOnly():
properties = "&sNativeProperties"
@ -2501,7 +2496,6 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
${protoClass}, ${protoCache},
constructorProto, ${interfaceClass}, ${constructHookHolder}, ${constructArgs}, ${namedConstructors},
${interfaceCache},
${domClass},
${properties},
${chromeProperties},
${name}, aDefineOnGlobal);
@ -2513,7 +2507,6 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
constructArgs=constructArgs,
namedConstructors=namedConstructors,
interfaceCache=interfaceCache,
domClass=domClass,
properties=properties,
chromeProperties=chromeProperties,
name='"' + self.descriptor.interface.identifier.name + '"' if needInterfaceObject else "nullptr")

View File

@ -12,17 +12,15 @@
// We use slot 0 for holding the raw object. This is safe for both
// globals and non-globals.
// NOTE: This is baked into the Ion JIT as 0 in codegen for LGetDOMProperty and
// LSetDOMProperty. Those constants need to be changed accordingly if this value
// changes.
#define DOM_OBJECT_SLOT 0
// The total number of slots non-proxy DOM objects use by default.
// Specific objects may have more for storing cached values.
#define DOM_INSTANCE_RESERVED_SLOTS 1
// NOTE: This is baked into the Ion JIT as 0 in codegen for LGetDOMProperty and
// LSetDOMProperty. Those constants need to be changed accordingly if this value
// changes.
#define DOM_PROTO_INSTANCE_CLASS_SLOT 0
// Interface objects store a number of reserved slots equal to
// DOM_INTERFACE_SLOTS_BASE + number of named constructors.
#define DOM_INTERFACE_SLOTS_BASE 0
@ -30,6 +28,6 @@
// Interface prototype objects store a number of reserved slots equal to
// DOM_INTERFACE_PROTO_SLOTS_BASE or DOM_INTERFACE_PROTO_SLOTS_BASE + 1 if a
// slot for the unforgeable holder is needed.
#define DOM_INTERFACE_PROTO_SLOTS_BASE (DOM_PROTO_INSTANCE_CLASS_SLOT + 1)
#define DOM_INTERFACE_PROTO_SLOTS_BASE 0
#endif /* mozilla_dom_DOMSlots_h */