mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Remove unused slot in prototype object (fixes #8588)
This commit is contained in:
parent
b737e4e0fa
commit
7547bcac24
2 changed files with 2 additions and 30 deletions
|
@ -1847,7 +1847,7 @@ class CGPrototypeJSClass(CGThing):
|
||||||
return """\
|
return """\
|
||||||
static PrototypeClass: JSClass = JSClass {
|
static PrototypeClass: JSClass = JSClass {
|
||||||
name: %s as *const u8 as *const libc::c_char,
|
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,
|
addProperty: None,
|
||||||
delProperty: None,
|
delProperty: None,
|
||||||
getProperty: None,
|
getProperty: None,
|
||||||
|
@ -2360,14 +2360,6 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
||||||
else:
|
else:
|
||||||
protoClass = "Some(&PrototypeClass)"
|
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.hasInterfaceObject():
|
||||||
if self.descriptor.interface.ctor():
|
if self.descriptor.interface.ctor():
|
||||||
constructHook = CONSTRUCT_HOOK_NAME
|
constructHook = CONSTRUCT_HOOK_NAME
|
||||||
|
@ -2386,8 +2378,7 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
|
||||||
do_create_interface_objects(cx, receiver, parent_proto.handle(),
|
do_create_interface_objects(cx, receiver, parent_proto.handle(),
|
||||||
%s, %s,
|
%s, %s,
|
||||||
&named_constructors,
|
&named_constructors,
|
||||||
%s,
|
&sNativeProperties, rval);""" % (protoClass, constructor)
|
||||||
&sNativeProperties, rval);""" % (protoClass, constructor, domClass)
|
|
||||||
|
|
||||||
createArray = """\
|
createArray = """\
|
||||||
let named_constructors: [(NonNullJSNative, &'static str, u32); %d] = [
|
let named_constructors: [(NonNullJSNative, &'static str, u32); %d] = [
|
||||||
|
|
|
@ -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.
|
/// The index of the slot that contains a reference to the ProtoOrIfaceArray.
|
||||||
// All DOM globals must have a slot at DOM_PROTOTYPE_SLOT.
|
// All DOM globals must have a slot at DOM_PROTOTYPE_SLOT.
|
||||||
pub const DOM_PROTOTYPE_SLOT: u32 = js::JSCLASS_GLOBAL_SLOT_COUNT;
|
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>,
|
proto_class: Option<&'static JSClass>,
|
||||||
constructor: Option<(NonNullJSNative, &'static str, u32)>,
|
constructor: Option<(NonNullJSNative, &'static str, u32)>,
|
||||||
named_constructors: &[(NonNullJSNative, &'static str, u32)],
|
named_constructors: &[(NonNullJSNative, &'static str, u32)],
|
||||||
dom_class: Option<&'static DOMClass>,
|
|
||||||
members: &'static NativeProperties,
|
members: &'static NativeProperties,
|
||||||
rval: MutableHandleObject) {
|
rval: MutableHandleObject) {
|
||||||
assert!(rval.get().is_null());
|
assert!(rval.get().is_null());
|
||||||
if let Some(proto_class) = proto_class {
|
if let Some(proto_class) = proto_class {
|
||||||
create_interface_prototype_object(cx, proto_proto, proto_class, members, rval);
|
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 {
|
if let Some((native, name, nargs)) = constructor {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue