Remove unused slot in prototype object (fixes #8588)

This commit is contained in:
Anthony Ramine 2015-11-30 14:48:24 +01:00
parent b737e4e0fa
commit 7547bcac24
2 changed files with 2 additions and 30 deletions

View file

@ -1847,7 +1847,7 @@ class CGPrototypeJSClass(CGThing):
return """\
static PrototypeClass: JSClass = JSClass {
name: %s as *const u8 as *const libc::c_char,
flags: (1 & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT, //JSCLASS_HAS_RESERVED_SLOTS(1)
flags: 0,
addProperty: None,
delProperty: None,
getProperty: None,
@ -2360,14 +2360,6 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
else:
protoClass = "Some(&PrototypeClass)"
if self.descriptor.concrete:
if self.descriptor.proxy:
domClass = "Some(&Class)"
else:
domClass = "Some(&Class.dom_class)"
else:
domClass = "None"
if self.descriptor.interface.hasInterfaceObject():
if self.descriptor.interface.ctor():
constructHook = CONSTRUCT_HOOK_NAME
@ -2386,8 +2378,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
do_create_interface_objects(cx, receiver, parent_proto.handle(),
%s, %s,
&named_constructors,
%s,
&sNativeProperties, rval);""" % (protoClass, constructor, domClass)
&sNativeProperties, rval);""" % (protoClass, constructor)
createArray = """\
let named_constructors: [(NonNullJSNative, &'static str, u32); %d] = [

View file

@ -78,11 +78,6 @@ impl GlobalStaticData {
}
}
// 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.
const DOM_PROTO_INSTANCE_CLASS_SLOT: u32 = 0;
/// The index of the slot that contains a reference to the ProtoOrIfaceArray.
// All DOM globals must have a slot at DOM_PROTOTYPE_SLOT.
pub const DOM_PROTOTYPE_SLOT: u32 = js::JSCLASS_GLOBAL_SLOT_COUNT;
@ -210,25 +205,11 @@ pub fn do_create_interface_objects(cx: *mut JSContext,
proto_class: Option<&'static JSClass>,
constructor: Option<(NonNullJSNative, &'static str, u32)>,
named_constructors: &[(NonNullJSNative, &'static str, u32)],
dom_class: Option<&'static DOMClass>,
members: &'static NativeProperties,
rval: MutableHandleObject) {
assert!(rval.get().is_null());
if let Some(proto_class) = proto_class {
create_interface_prototype_object(cx, proto_proto, proto_class, members, rval);
if !rval.get().is_null() {
let dom_class_ptr = match dom_class {
Some(dom_class) => dom_class as *const DOMClass as *const libc::c_void,
None => ptr::null() as *const libc::c_void,
};
unsafe {
JS_SetReservedSlot(rval.get(),
DOM_PROTO_INSTANCE_CLASS_SLOT,
PrivateValue(dom_class_ptr));
}
}
}
if let Some((native, name, nargs)) = constructor {