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

@ -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 {