Auto merge of #10756 - servo:smup, r=Ms2ger

Update SpiderMonkey

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10756)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-05-03 15:46:40 -07:00
commit 2c69278067
21 changed files with 180 additions and 194 deletions

View file

@ -14,10 +14,6 @@
DOMInterfaces = { DOMInterfaces = {
'Window': {
'outerObjectHook': 'Some(bindings::utils::outerize_global)',
},
'Range': { 'Range': {
'weakReferenceable': True, 'weakReferenceable': True,
}, },

View file

@ -1587,7 +1587,7 @@ class AttrDefiner(PropertyDefiner):
flags = "JSPROP_ENUMERATE | JSPROP_SHARED" flags = "JSPROP_ENUMERATE | JSPROP_SHARED"
if self.unforgeable: if self.unforgeable:
flags += " | JSPROP_READONLY | JSPROP_PERMANENT" flags += " | JSPROP_PERMANENT"
def getter(attr): def getter(attr):
if self.static: if self.static:
@ -1630,7 +1630,7 @@ class AttrDefiner(PropertyDefiner):
array, name, array, name,
' JSPropertySpec {\n' ' JSPropertySpec {\n'
' name: %s as *const u8 as *const libc::c_char,\n' ' name: %s as *const u8 as *const libc::c_char,\n'
' flags: ((%s) & 0xFF) as u8,\n' ' flags: (%s) as u8,\n'
' getter: %s,\n' ' getter: %s,\n'
' setter: %s\n' ' setter: %s\n'
' }', ' }',
@ -1867,7 +1867,6 @@ class CGDOMJSClass(CGThing):
"finalizeHook": FINALIZE_HOOK_NAME, "finalizeHook": FINALIZE_HOOK_NAME,
"flags": "0", "flags": "0",
"name": str_to_const_array(self.descriptor.interface.identifier.name), "name": str_to_const_array(self.descriptor.interface.identifier.name),
"outerObjectHook": self.descriptor.outerObjectHook,
"resolveHook": "None", "resolveHook": "None",
"slots": "1", "slots": "1",
"traceHook": TRACE_HOOK_NAME, "traceHook": TRACE_HOOK_NAME,
@ -1885,7 +1884,7 @@ class CGDOMJSClass(CGThing):
static Class: DOMJSClass = DOMJSClass { static Class: DOMJSClass = DOMJSClass {
base: js::jsapi::Class { base: js::jsapi::Class {
name: %(name)s as *const u8 as *const libc::c_char, name: %(name)s as *const u8 as *const libc::c_char,
flags: JSCLASS_IS_DOMJSCLASS | JSCLASS_IMPLEMENTS_BARRIERS | %(flags)s | flags: JSCLASS_IS_DOMJSCLASS | %(flags)s |
(((%(slots)s) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT) (((%(slots)s) & JSCLASS_RESERVED_SLOTS_MASK) << JSCLASS_RESERVED_SLOTS_SHIFT)
/* JSCLASS_HAS_RESERVED_SLOTS(%(slots)s) */, /* JSCLASS_HAS_RESERVED_SLOTS(%(slots)s) */,
addProperty: None, addProperty: None,
@ -1894,7 +1893,7 @@ static Class: DOMJSClass = DOMJSClass {
setProperty: None, setProperty: None,
enumerate: %(enumerateHook)s, enumerate: %(enumerateHook)s,
resolve: %(resolveHook)s, resolve: %(resolveHook)s,
convert: None, mayResolve: None,
finalize: Some(%(finalizeHook)s), finalize: Some(%(finalizeHook)s),
call: None, call: None,
hasInstance: None, hasInstance: None,
@ -1902,19 +1901,17 @@ static Class: DOMJSClass = DOMJSClass {
trace: Some(%(traceHook)s), trace: Some(%(traceHook)s),
spec: js::jsapi::ClassSpec { spec: js::jsapi::ClassSpec {
createConstructor: None, createConstructor_: None,
createPrototype: None, createPrototype_: None,
constructorFunctions: 0 as *const js::jsapi::JSFunctionSpec, constructorFunctions_: 0 as *const js::jsapi::JSFunctionSpec,
constructorProperties: 0 as *const js::jsapi::JSPropertySpec, constructorProperties_: 0 as *const js::jsapi::JSPropertySpec,
prototypeFunctions: 0 as *const js::jsapi::JSFunctionSpec, prototypeFunctions_: 0 as *const js::jsapi::JSFunctionSpec,
prototypeProperties: 0 as *const js::jsapi::JSPropertySpec, prototypeProperties_: 0 as *const js::jsapi::JSPropertySpec,
finishInit: None, finishInit_: None,
flags: 0, flags: 0,
}, },
ext: js::jsapi::ClassExtension { ext: js::jsapi::ClassExtension {
outerObject: %(outerObjectHook)s,
innerObject: None,
isWrappedNative: false, isWrappedNative: false,
weakmapKeyDelegateOp: None, weakmapKeyDelegateOp: None,
objectMovedOp: None, objectMovedOp: None,
@ -1932,7 +1929,6 @@ static Class: DOMJSClass = DOMJSClass {
unwatch: None, unwatch: None,
getElements: None, getElements: None,
enumerate: None, enumerate: None,
thisObject: %(outerObjectHook)s,
funToString: None, funToString: None,
}, },
}, },
@ -1966,13 +1962,13 @@ static PrototypeClass: JSClass = JSClass {
setProperty: None, setProperty: None,
enumerate: None, enumerate: None,
resolve: None, resolve: None,
convert: None, mayResolve: None,
finalize: None, finalize: None,
call: None, call: None,
hasInstance: None, hasInstance: None,
construct: None, construct: None,
trace: None, trace: None,
reserved: [0 as *mut libc::c_void; 26] reserved: [0 as *mut os::raw::c_void; 23]
}; };
""" % {'name': name, 'slotCount': slotCount} """ % {'name': name, 'slotCount': slotCount}
@ -2539,10 +2535,11 @@ class CGCreateInterfaceObjectsMethod(CGAbstractMethod):
let mut interface = RootedObject::new(cx, ptr::null_mut()); let mut interface = RootedObject::new(cx, ptr::null_mut());
create_callback_interface_object(cx, global, sConstants, %(name)s, interface.handle_mut()); create_callback_interface_object(cx, global, sConstants, %(name)s, interface.handle_mut());
assert!(!interface.ptr.is_null()); assert!(!interface.ptr.is_null());
assert!((*cache)[PrototypeList::Constructor::%(id)s as usize].is_null());
(*cache)[PrototypeList::Constructor::%(id)s as usize] = interface.ptr; (*cache)[PrototypeList::Constructor::%(id)s as usize] = interface.ptr;
if <*mut JSObject>::needs_post_barrier(interface.ptr) { <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::%(id)s as isize),
<*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::%(id)s as isize)); ptr::null_mut(),
} interface.ptr);
""" % {"id": name, "name": str_to_const_array(name)}) """ % {"id": name, "name": str_to_const_array(name)})
if len(self.descriptor.prototypeChain) == 1: if len(self.descriptor.prototypeChain) == 1:
@ -2582,10 +2579,12 @@ create_interface_prototype_object(cx,
%(consts)s, %(consts)s,
prototype.handle_mut()); prototype.handle_mut());
assert!(!prototype.ptr.is_null()); assert!(!prototype.ptr.is_null());
assert!((*cache)[PrototypeList::ID::%(id)s as usize].is_null());
(*cache)[PrototypeList::ID::%(id)s as usize] = prototype.ptr; (*cache)[PrototypeList::ID::%(id)s as usize] = prototype.ptr;
if <*mut JSObject>::needs_post_barrier(prototype.ptr) { <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::%(id)s as isize),
<*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::ID::%(id)s as isize)); ptr::null_mut(),
}""" % properties)) prototype.ptr);
""" % properties))
if self.descriptor.interface.hasInterfaceObject(): if self.descriptor.interface.hasInterfaceObject():
properties["name"] = str_to_const_array(name) properties["name"] = str_to_const_array(name)
@ -2619,10 +2618,12 @@ create_noncallback_interface_object(cx,
assert!(!interface.ptr.is_null());""" % properties)) assert!(!interface.ptr.is_null());""" % properties))
if self.descriptor.hasDescendants(): if self.descriptor.hasDescendants():
code.append(CGGeneric("""\ code.append(CGGeneric("""\
assert!((*cache)[PrototypeList::Constructor::%(id)s as usize].is_null());
(*cache)[PrototypeList::Constructor::%(id)s as usize] = interface.ptr; (*cache)[PrototypeList::Constructor::%(id)s as usize] = interface.ptr;
if <*mut JSObject>::needs_post_barrier(prototype.ptr) { <*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::%(id)s as isize),
<*mut JSObject>::post_barrier((*cache).as_mut_ptr().offset(PrototypeList::Constructor::%(id)s as isize)); ptr::null_mut(),
}""" % properties)) interface.ptr);
""" % properties))
constructors = self.descriptor.interface.namedConstructors constructors = self.descriptor.interface.namedConstructors
if constructors: if constructors:
@ -3310,7 +3311,7 @@ class CGMemberJITInfo(CGThing):
aliasSet, alwaysInSlot, lazilyInSlot, slotIndex, aliasSet, alwaysInSlot, lazilyInSlot, slotIndex,
returnTypes, args): returnTypes, args):
""" """
aliasSet is a JSJitInfo::AliasSet value, without the "JSJitInfo::" bit. aliasSet is a JSJitInfo_AliasSet value, without the "JSJitInfo_AliasSet::" bit.
args is None if we don't want to output argTypes for some args is None if we don't want to output argTypes for some
reason (e.g. we have overloads or we're not a method) and reason (e.g. we have overloads or we're not a method) and
@ -3323,16 +3324,17 @@ class CGMemberJITInfo(CGThing):
initializer = fill( initializer = fill(
""" """
JSJitInfo { JSJitInfo {
call: ${opName} as *const ::libc::c_void, call: ${opName} as *const os::raw::c_void,
protoID: PrototypeList::ID::${name} as u16, protoID: PrototypeList::ID::${name} as u16,
depth: ${depth}, depth: ${depth},
_bitfield_1: _bitfield_1:
JSJitInfo::new_bitfield_1( JSJitInfo::new_bitfield_1(
OpType::${opType} as u8, JSJitInfo_OpType::${opType} as u8,
AliasSet::${aliasSet} as u8, JSJitInfo_AliasSet::${aliasSet} as u8,
JSValueType::${returnType} as u8, JSValueType::${returnType} as u8,
${isInfallible}, ${isInfallible},
${isMovable}, ${isMovable},
${isEliminatable},
${isAlwaysInSlot}, ${isAlwaysInSlot},
${isLazilyCachedInSlot}, ${isLazilyCachedInSlot},
${isTypedMethod}, ${isTypedMethod},
@ -3349,6 +3351,8 @@ class CGMemberJITInfo(CGThing):
""), ""),
isInfallible=toStringBool(infallible), isInfallible=toStringBool(infallible),
isMovable=toStringBool(movable), isMovable=toStringBool(movable),
# FIXME(nox): https://github.com/servo/servo/issues/10991
isEliminatable=toStringBool(False),
isAlwaysInSlot=toStringBool(alwaysInSlot), isAlwaysInSlot=toStringBool(alwaysInSlot),
isLazilyCachedInSlot=toStringBool(lazilyInSlot), isLazilyCachedInSlot=toStringBool(lazilyInSlot),
isTypedMethod=toStringBool(isTypedMethod), isTypedMethod=toStringBool(isTypedMethod),
@ -3358,7 +3362,7 @@ class CGMemberJITInfo(CGThing):
if args is not None: if args is not None:
argTypes = "%s_argTypes" % infoName argTypes = "%s_argTypes" % infoName
args = [CGMemberJITInfo.getJSArgType(arg.type) for arg in args] args = [CGMemberJITInfo.getJSArgType(arg.type) for arg in args]
args.append("ArgType::ArgTypeListEnd as i32") args.append("JSJitInfo_ArgType::ArgTypeListEnd as i32")
argTypesDecl = ( argTypesDecl = (
"const %s: [i32; %d] = [ %s ];\n" % "const %s: [i32; %d] = [ %s ];\n" %
(argTypes, len(args), ", ".join(args))) (argTypes, len(args), ", ".join(args)))
@ -3367,7 +3371,7 @@ class CGMemberJITInfo(CGThing):
$*{argTypesDecl} $*{argTypesDecl}
const ${infoName}: JSTypedMethodJitInfo = JSTypedMethodJitInfo { const ${infoName}: JSTypedMethodJitInfo = JSTypedMethodJitInfo {
base: ${jitInfo}, base: ${jitInfo},
argTypes: &${argTypes} as *const _ as *const ArgType, argTypes: &${argTypes} as *const _ as *const JSJitInfo_ArgType,
}; };
""", """,
argTypesDecl=argTypesDecl, argTypesDecl=argTypesDecl,
@ -3581,56 +3585,56 @@ class CGMemberJITInfo(CGThing):
assert not t.isVoid() assert not t.isVoid()
if t.nullable(): if t.nullable():
# Sometimes it might return null, sometimes not # Sometimes it might return null, sometimes not
return "ArgType::Null as i32 | %s" % CGMemberJITInfo.getJSArgType(t.inner) return "JSJitInfo_ArgType::Null as i32 | %s" % CGMemberJITInfo.getJSArgType(t.inner)
if t.isArray(): if t.isArray():
# No idea yet # No idea yet
assert False assert False
if t.isSequence(): if t.isSequence():
return "ArgType::Object as i32" return "JSJitInfo_ArgType::Object as i32"
if t.isGeckoInterface(): if t.isGeckoInterface():
return "ArgType::Object as i32" return "JSJitInfo_ArgType::Object as i32"
if t.isString(): if t.isString():
return "ArgType::String as i32" return "JSJitInfo_ArgType::String as i32"
if t.isEnum(): if t.isEnum():
return "ArgType::String as i32" return "JSJitInfo_ArgType::String as i32"
if t.isCallback(): if t.isCallback():
return "ArgType::Object as i32" return "JSJitInfo_ArgType::Object as i32"
if t.isAny(): if t.isAny():
# The whole point is to return various stuff # The whole point is to return various stuff
return "ArgType::Any as i32" return "JSJitInfo_ArgType::Any as i32"
if t.isObject(): if t.isObject():
return "ArgType::Object as i32" return "JSJitInfo_ArgType::Object as i32"
if t.isSpiderMonkeyInterface(): if t.isSpiderMonkeyInterface():
return "ArgType::Object as i32" return "JSJitInfo_ArgType::Object as i32"
if t.isUnion(): if t.isUnion():
u = t.unroll() u = t.unroll()
type = "JSJitInfo::Null as i32" if u.hasNullableType else "" type = "JSJitInfo::Null as i32" if u.hasNullableType else ""
return reduce(CGMemberJITInfo.getSingleArgType, return reduce(CGMemberJITInfo.getSingleArgType,
u.flatMemberTypes, type) u.flatMemberTypes, type)
if t.isDictionary(): if t.isDictionary():
return "ArgType::Object as i32" return "JSJitInfo_ArgType::Object as i32"
if t.isDate(): if t.isDate():
return "ArgType::Object as i32" return "JSJitInfo_ArgType::Object as i32"
if not t.isPrimitive(): if not t.isPrimitive():
raise TypeError("No idea what type " + str(t) + " is.") raise TypeError("No idea what type " + str(t) + " is.")
tag = t.tag() tag = t.tag()
if tag == IDLType.Tags.bool: if tag == IDLType.Tags.bool:
return "ArgType::Boolean as i32" return "JSJitInfo_ArgType::Boolean as i32"
if tag in [IDLType.Tags.int8, IDLType.Tags.uint8, if tag in [IDLType.Tags.int8, IDLType.Tags.uint8,
IDLType.Tags.int16, IDLType.Tags.uint16, IDLType.Tags.int16, IDLType.Tags.uint16,
IDLType.Tags.int32]: IDLType.Tags.int32]:
return "ArgType::Integer as i32" return "JSJitInfo_ArgType::Integer as i32"
if tag in [IDLType.Tags.int64, IDLType.Tags.uint64, if tag in [IDLType.Tags.int64, IDLType.Tags.uint64,
IDLType.Tags.unrestricted_float, IDLType.Tags.float, IDLType.Tags.unrestricted_float, IDLType.Tags.float,
IDLType.Tags.unrestricted_double, IDLType.Tags.double]: IDLType.Tags.unrestricted_double, IDLType.Tags.double]:
# These all use JS_NumberValue, which can return int or double. # These all use JS_NumberValue, which can return int or double.
# But TI treats "double" as meaning "int or double", so we're # But TI treats "double" as meaning "int or double", so we're
# good to return JSVAL_TYPE_DOUBLE here. # good to return JSVAL_TYPE_DOUBLE here.
return "ArgType::Double as i32" return "JSJitInfo_ArgType::Double as i32"
if tag != IDLType.Tags.uint32: if tag != IDLType.Tags.uint32:
raise TypeError("No idea what type " + str(t) + " is.") raise TypeError("No idea what type " + str(t) + " is.")
# uint32 is sometimes int and sometimes double. # uint32 is sometimes int and sometimes double.
return "ArgType::Double as i32" return "JSJitInfo_ArgType::Double as i32"
@staticmethod @staticmethod
def getSingleArgType(existingType, t): def getSingleArgType(existingType, t):
@ -4462,7 +4466,7 @@ class CGDOMJSProxyHandler_getOwnPropertyDescriptor(CGAbstractExternMethod):
def __init__(self, descriptor): def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'), args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'),
Argument('HandleId', 'id'), Argument('HandleId', 'id'),
Argument('MutableHandle<JSPropertyDescriptor>', 'desc')] Argument('MutableHandle<PropertyDescriptor>', 'desc')]
CGAbstractExternMethod.__init__(self, descriptor, "getOwnPropertyDescriptor", CGAbstractExternMethod.__init__(self, descriptor, "getOwnPropertyDescriptor",
"bool", args) "bool", args)
self.descriptor = descriptor self.descriptor = descriptor
@ -4548,7 +4552,7 @@ class CGDOMJSProxyHandler_defineProperty(CGAbstractExternMethod):
def __init__(self, descriptor): def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'), args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'),
Argument('HandleId', 'id'), Argument('HandleId', 'id'),
Argument('Handle<JSPropertyDescriptor>', 'desc'), Argument('Handle<PropertyDescriptor>', 'desc'),
Argument('*mut ObjectOpResult', 'opresult')] Argument('*mut ObjectOpResult', 'opresult')]
CGAbstractExternMethod.__init__(self, descriptor, "defineProperty", "bool", args) CGAbstractExternMethod.__init__(self, descriptor, "defineProperty", "bool", args)
self.descriptor = descriptor self.descriptor = descriptor
@ -4654,7 +4658,7 @@ class CGDOMJSProxyHandler_ownPropertyKeys(CGAbstractExternMethod):
""" """
for name in (*unwrapped_proxy).SupportedPropertyNames() { for name in (*unwrapped_proxy).SupportedPropertyNames() {
let cstring = CString::new(name).unwrap(); let cstring = CString::new(name).unwrap();
let jsstring = JS_InternString(cx, cstring.as_ptr()); let jsstring = JS_AtomizeAndPinString(cx, cstring.as_ptr());
let rooted = RootedString::new(cx, jsstring); let rooted = RootedString::new(cx, jsstring);
let jsid = INTERNED_STRING_TO_JSID(cx, rooted.handle().get()); let jsid = INTERNED_STRING_TO_JSID(cx, rooted.handle().get());
let rooted_jsid = RootedId::new(cx, jsid); let rooted_jsid = RootedId::new(cx, jsid);
@ -4775,7 +4779,7 @@ return true;"""
class CGDOMJSProxyHandler_get(CGAbstractExternMethod): class CGDOMJSProxyHandler_get(CGAbstractExternMethod):
def __init__(self, descriptor): def __init__(self, descriptor):
args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'), args = [Argument('*mut JSContext', 'cx'), Argument('HandleObject', 'proxy'),
Argument('HandleObject', 'receiver'), Argument('HandleId', 'id'), Argument('HandleValue', 'receiver'), Argument('HandleId', 'id'),
Argument('MutableHandleValue', 'vp')] Argument('MutableHandleValue', 'vp')]
CGAbstractExternMethod.__init__(self, descriptor, "get", "bool", args) CGAbstractExternMethod.__init__(self, descriptor, "get", "bool", args)
self.descriptor = descriptor self.descriptor = descriptor
@ -5511,13 +5515,12 @@ class CGBindingRoot(CGThing):
# Add imports # Add imports
curr = CGImports(curr, descriptors + callbackDescriptors, mainCallbacks, [ curr = CGImports(curr, descriptors + callbackDescriptors, mainCallbacks, [
'js', 'js',
'js::{JSCLASS_GLOBAL_SLOT_COUNT, JSCLASS_IMPLEMENTS_BARRIERS}', 'js::{JS_CALLEE, JSCLASS_GLOBAL_SLOT_COUNT}',
'js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL, JSCLASS_RESERVED_SLOTS_MASK}', 'js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL, JSCLASS_RESERVED_SLOTS_MASK}',
'js::{JSCLASS_RESERVED_SLOTS_SHIFT, JSITER_HIDDEN, JSITER_OWNONLY}',
'js::{JSITER_SYMBOLS, JSPROP_ENUMERATE, JSPROP_PERMANENT, JSPROP_READONLY}',
'js::{JSPROP_SHARED, JS_CALLEE}',
'js::error::throw_type_error', 'js::error::throw_type_error',
'js::jsapi::{AliasSet, ArgType, AutoIdVector, CallArgs, FreeOp}', 'js::jsapi::{JSJitInfo_AliasSet, JSJitInfo_ArgType, AutoIdVector, CallArgs, FreeOp}',
'js::jsapi::{JSITER_SYMBOLS, JSPROP_ENUMERATE, JSPROP_PERMANENT, JSPROP_READONLY, JSPROP_SHARED}',
'js::jsapi::{JSCLASS_RESERVED_SLOTS_SHIFT, JSITER_HIDDEN, JSITER_OWNONLY}',
'js::jsapi::{GetGlobalForObjectCrossCompartment , GetPropertyKeys, Handle}', 'js::jsapi::{GetGlobalForObjectCrossCompartment , GetPropertyKeys, Handle}',
'js::jsapi::{HandleId, HandleObject, HandleValue, HandleValueArray}', 'js::jsapi::{HandleId, HandleObject, HandleValue, HandleValueArray}',
'js::jsapi::{INTERNED_STRING_TO_JSID, IsCallable, JS_CallFunctionValue}', 'js::jsapi::{INTERNED_STRING_TO_JSID, IsCallable, JS_CallFunctionValue}',
@ -5526,16 +5529,16 @@ class CGBindingRoot(CGThing):
'js::jsapi::{JS_GetGlobalForObject, JS_GetObjectPrototype, JS_GetProperty}', 'js::jsapi::{JS_GetGlobalForObject, JS_GetObjectPrototype, JS_GetProperty}',
'js::jsapi::{JS_GetPropertyById, JS_GetPropertyDescriptorById, JS_GetReservedSlot}', 'js::jsapi::{JS_GetPropertyById, JS_GetPropertyDescriptorById, JS_GetReservedSlot}',
'js::jsapi::{JS_HasProperty, JS_HasPropertyById, JS_InitializePropertiesFromCompatibleNativeObject}', 'js::jsapi::{JS_HasProperty, JS_HasPropertyById, JS_InitializePropertiesFromCompatibleNativeObject}',
'js::jsapi::{JS_InternString, JS_IsExceptionPending, JS_NewObject, JS_NewObjectWithGivenProto}', 'js::jsapi::{JS_AtomizeAndPinString, JS_IsExceptionPending, JS_NewObject, JS_NewObjectWithGivenProto}',
'js::jsapi::{JS_NewObjectWithoutMetadata, JS_NewStringCopyZ, JS_SetProperty}', 'js::jsapi::{JS_NewObjectWithoutMetadata, JS_NewStringCopyZ, JS_SetProperty}',
'js::jsapi::{JS_SetPrototype, JS_SetReservedSlot, JS_WrapValue, JSAutoCompartment}', 'js::jsapi::{JS_SetPrototype, JS_SetReservedSlot, JS_WrapValue, JSAutoCompartment}',
'js::jsapi::{JSAutoRequest, JSContext, JSClass, JSFreeOp, JSFunctionSpec}', 'js::jsapi::{JSAutoRequest, JSContext, JSClass, JSFreeOp, JSFunctionSpec}',
'js::jsapi::{JSJitGetterCallArgs, JSJitInfo, JSJitMethodCallArgs, JSJitSetterCallArgs}', 'js::jsapi::{JSJitGetterCallArgs, JSJitInfo, JSJitMethodCallArgs, JSJitSetterCallArgs}',
'js::jsapi::{JSNative, JSObject, JSNativeWrapper, JSPropertyDescriptor, JSPropertySpec}', 'js::jsapi::{JSNative, JSObject, JSNativeWrapper, JSPropertySpec}',
'js::jsapi::{JSString, JSTracer, JSType, JSTypedMethodJitInfo, JSValueType}', 'js::jsapi::{JSString, JSTracer, JSType, JSTypedMethodJitInfo, JSValueType}',
'js::jsapi::{ObjectOpResult, OpType, MutableHandle, MutableHandleObject}', 'js::jsapi::{ObjectOpResult, JSJitInfo_OpType, MutableHandle, MutableHandleObject}',
'js::jsapi::{MutableHandleValue, RootedId, RootedObject, RootedString}', 'js::jsapi::{MutableHandleValue, PropertyDescriptor, RootedId, RootedObject}',
'js::jsapi::{RootedValue, SymbolCode, jsid}', 'js::jsapi::{RootedString, RootedValue, SymbolCode, jsid}',
'js::jsval::JSVal', 'js::jsval::JSVal',
'js::jsval::{ObjectValue, ObjectOrNullValue, PrivateValue}', 'js::jsval::{ObjectValue, ObjectOrNullValue, PrivateValue}',
'js::jsval::{NullValue, UndefinedValue}', 'js::jsval::{NullValue, UndefinedValue}',
@ -5596,6 +5599,7 @@ class CGBindingRoot(CGThing):
'std::cmp', 'std::cmp',
'std::mem', 'std::mem',
'std::num', 'std::num',
'std::os',
'std::ptr', 'std::ptr',
'std::str', 'std::str',
'std::rc', 'std::rc',

View file

@ -281,7 +281,7 @@ pub unsafe fn private_from_proto_check<F>(mut obj: *mut JSObject,
let dom_class = try!(get_dom_class(obj).or_else(|_| { let dom_class = try!(get_dom_class(obj).or_else(|_| {
if IsWrapper(obj) { if IsWrapper(obj) {
debug!("found wrapper"); debug!("found wrapper");
obj = UnwrapObject(obj, /* stopAtOuter = */ 0); obj = UnwrapObject(obj, /* stopAtWindowProxy = */ 0);
if obj.is_null() { if obj.is_null() {
debug!("unwrapping security wrapper failed"); debug!("unwrapping security wrapper failed");
Err(()) Err(())
@ -424,7 +424,9 @@ unsafe impl ArrayBufferViewContents for f64 {
pub unsafe fn array_buffer_view_data<'a, T: ArrayBufferViewContents>(abv: *mut JSObject) -> Option<&'a mut [T]> { pub unsafe fn array_buffer_view_data<'a, T: ArrayBufferViewContents>(abv: *mut JSObject) -> Option<&'a mut [T]> {
let mut byte_length = 0; let mut byte_length = 0;
let mut ptr = ptr::null_mut(); let mut ptr = ptr::null_mut();
let ret = JS_GetObjectAsArrayBufferView(abv, &mut byte_length, &mut ptr); let mut is_shared = false;
let ret = JS_GetObjectAsArrayBufferView(abv, &mut byte_length, &mut is_shared, &mut ptr);
assert!(!is_shared);
if ret.is_null() { if ret.is_null() {
return None; return None;
} }
@ -463,5 +465,7 @@ pub fn array_buffer_view_to_vec_checked<T: ArrayBufferViewContents>(abv: *mut JS
/// Note: Currently only Arrays are supported. /// Note: Currently only Arrays are supported.
/// TODO: Expand this to support sequences and other array-like objects /// TODO: Expand this to support sequences and other array-like objects
pub unsafe fn is_array_like(cx: *mut JSContext, value: HandleValue) -> bool { pub unsafe fn is_array_like(cx: *mut JSContext, value: HandleValue) -> bool {
JS_IsArrayObject(cx, value) let mut result = false;
assert!(JS_IsArrayObject(cx, value, &mut result));
result
} }

View file

@ -11,15 +11,15 @@ use js::error::throw_type_error;
use js::glue::UncheckedUnwrapObject; use js::glue::UncheckedUnwrapObject;
use js::jsapi::{Class, ClassExtension, ClassSpec, GetGlobalForObjectCrossCompartment}; use js::jsapi::{Class, ClassExtension, ClassSpec, GetGlobalForObjectCrossCompartment};
use js::jsapi::{HandleObject, HandleValue, JSClass, JSContext, JSFunctionSpec}; use js::jsapi::{HandleObject, HandleValue, JSClass, JSContext, JSFunctionSpec};
use js::jsapi::{JSNative, JSPropertySpec, JSString, JS_DefineProperty1, JS_DefineProperty2}; use js::jsapi::{JSNative, JSFUN_CONSTRUCTOR, JSPROP_ENUMERATE, JSPROP_PERMANENT, JSPROP_READONLY};
use js::jsapi::{JS_DefineProperty4, JS_GetClass, JS_GetFunctionObject, JS_GetPrototype}; use js::jsapi::{JSPROP_RESOLVING, JSPropertySpec, JSString, JS_DefineProperty1, JS_DefineProperty2};
use js::jsapi::{JS_InternString, JS_LinkConstructorAndPrototype, JS_NewFunction, JS_NewObject}; use js::jsapi::{JS_AtomizeAndPinString, JS_DefineProperty4, JS_GetClass, JS_GetFunctionObject};
use js::jsapi::{JS_GetPrototype, JS_LinkConstructorAndPrototype, JS_NewFunction, JS_NewObject};
use js::jsapi::{JS_NewObjectWithUniqueType, JS_NewStringCopyZ, JS_DefineProperty}; use js::jsapi::{JS_NewObjectWithUniqueType, JS_NewStringCopyZ, JS_DefineProperty};
use js::jsapi::{MutableHandleObject, MutableHandleValue, ObjectOps, RootedObject, RootedString}; use js::jsapi::{MutableHandleObject, MutableHandleValue, ObjectOps, RootedObject, RootedString};
use js::jsapi::{RootedValue, Value}; use js::jsapi::{RootedValue, Value};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UInt32Value}; use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UInt32Value};
use js::rust::{define_methods, define_properties}; use js::rust::{define_methods, define_properties};
use js::{JSPROP_ENUMERATE, JSFUN_CONSTRUCTOR, JSPROP_PERMANENT, JSPROP_READONLY};
use libc; use libc;
use std::ptr; use std::ptr;
@ -127,25 +127,23 @@ impl NonCallbackInterfaceObjectClass {
setProperty: None, setProperty: None,
enumerate: None, enumerate: None,
resolve: None, resolve: None,
convert: None, mayResolve: None,
finalize: None, finalize: None,
call: constructor_behavior.call, call: constructor_behavior.call,
construct: constructor_behavior.construct, construct: constructor_behavior.construct,
hasInstance: Some(has_instance_hook), hasInstance: Some(has_instance_hook),
trace: None, trace: None,
spec: ClassSpec { spec: ClassSpec {
createConstructor: None, createConstructor_: None,
createPrototype: None, createPrototype_: None,
constructorFunctions: ptr::null(), constructorFunctions_: ptr::null(),
constructorProperties: ptr::null(), constructorProperties_: ptr::null(),
prototypeFunctions: ptr::null(), prototypeFunctions_: ptr::null(),
prototypeProperties: ptr::null(), prototypeProperties_: ptr::null(),
finishInit: None, finishInit_: None,
flags: 0, flags: 0,
}, },
ext: ClassExtension { ext: ClassExtension {
outerObject: None,
innerObject: None,
isWrappedNative: false, isWrappedNative: false,
weakmapKeyDelegateOp: None, weakmapKeyDelegateOp: None,
objectMovedOp: None, objectMovedOp: None,
@ -162,7 +160,6 @@ impl NonCallbackInterfaceObjectClass {
unwatch: None, unwatch: None,
getElements: None, getElements: None,
enumerate: None, enumerate: None,
thisObject: None,
funToString: Some(fun_to_string_hook), funToString: Some(fun_to_string_hook),
} }
}, },
@ -325,7 +322,7 @@ unsafe fn has_instance(
let js_class = JS_GetClass(interface_object.get()); let js_class = JS_GetClass(interface_object.get());
let object_class = &*(js_class as *const NonCallbackInterfaceObjectClass); let object_class = &*(js_class as *const NonCallbackInterfaceObjectClass);
if let Ok(dom_class) = get_dom_class(UncheckedUnwrapObject(value.ptr, /* stopAtOuter = */ 0)) { if let Ok(dom_class) = get_dom_class(UncheckedUnwrapObject(value.ptr, /* stopAtWindowProxy = */ 0)) {
if dom_class.interface_chain[object_class.proto_depth as usize] == object_class.proto_id { if dom_class.interface_chain[object_class.proto_depth as usize] == object_class.proto_id {
// Step 4. // Step 4.
return Ok(true); return Ok(true);
@ -394,8 +391,8 @@ pub unsafe fn define_prefable_properties(cx: *mut JSContext,
unsafe fn define_name(cx: *mut JSContext, obj: HandleObject, name: &'static [u8]) { unsafe fn define_name(cx: *mut JSContext, obj: HandleObject, name: &'static [u8]) {
assert!(*name.last().unwrap() == b'\0'); assert!(*name.last().unwrap() == b'\0');
let name = let name = RootedString::new(
RootedString::new(cx, JS_InternString(cx, name.as_ptr() as *const libc::c_char)); cx, JS_AtomizeAndPinString(cx, name.as_ptr() as *const libc::c_char));
assert!(!name.ptr.is_null()); assert!(!name.ptr.is_null());
assert!(JS_DefineProperty2(cx, assert!(JS_DefineProperty2(cx,
obj, obj,
@ -424,7 +421,7 @@ unsafe fn define_on_global_object(
receiver, receiver,
name.as_ptr() as *const libc::c_char, name.as_ptr() as *const libc::c_char,
obj, obj,
0, JSPROP_RESOLVING,
None, None)); None, None));
} }

View file

@ -8,16 +8,15 @@
use dom::bindings::conversions::is_dom_proxy; use dom::bindings::conversions::is_dom_proxy;
use dom::bindings::utils::delete_property_by_id; use dom::bindings::utils::delete_property_by_id;
use js::JSPROP_GETTER;
use js::glue::GetProxyExtra; use js::glue::GetProxyExtra;
use js::glue::InvokeGetOwnPropertyDescriptor; use js::glue::InvokeGetOwnPropertyDescriptor;
use js::glue::{GetProxyHandler, SetProxyExtra}; use js::glue::{GetProxyHandler, SetProxyExtra};
use js::jsapi::GetObjectProto; use js::jsapi::GetObjectProto;
use js::jsapi::JS_GetPropertyDescriptorById; use js::jsapi::JS_GetPropertyDescriptorById;
use js::jsapi::{Handle, HandleId, HandleObject, MutableHandle, ObjectOpResult, RootedObject}; use js::jsapi::{Handle, HandleId, HandleObject, MutableHandle, ObjectOpResult, RootedObject};
use js::jsapi::{JSContext, JSObject, JSPropertyDescriptor}; use js::jsapi::{JSContext, JSObject, JSPROP_GETTER, PropertyDescriptor};
use js::jsapi::{JSErrNum, JS_StrictPropertyStub}; use js::jsapi::{JSErrNum, JS_StrictPropertyStub};
use js::jsapi::{JS_DefinePropertyById6, JS_NewObjectWithGivenProto}; use js::jsapi::{JS_DefinePropertyById, JS_NewObjectWithGivenProto};
use js::jsval::ObjectValue; use js::jsval::ObjectValue;
use libc; use libc;
use std::{mem, ptr}; use std::{mem, ptr};
@ -31,7 +30,7 @@ static JSPROXYSLOT_EXPANDO: u32 = 0;
pub unsafe extern "C" fn get_property_descriptor(cx: *mut JSContext, pub unsafe extern "C" fn get_property_descriptor(cx: *mut JSContext,
proxy: HandleObject, proxy: HandleObject,
id: HandleId, id: HandleId,
desc: MutableHandle<JSPropertyDescriptor>) desc: MutableHandle<PropertyDescriptor>)
-> bool { -> bool {
let handler = GetProxyHandler(proxy.get()); let handler = GetProxyHandler(proxy.get());
if !InvokeGetOwnPropertyDescriptor(handler, cx, proxy, id, desc) { if !InvokeGetOwnPropertyDescriptor(handler, cx, proxy, id, desc) {
@ -54,7 +53,7 @@ pub unsafe extern "C" fn get_property_descriptor(cx: *mut JSContext,
pub unsafe extern "C" fn define_property(cx: *mut JSContext, pub unsafe extern "C" fn define_property(cx: *mut JSContext,
proxy: HandleObject, proxy: HandleObject,
id: HandleId, id: HandleId,
desc: Handle<JSPropertyDescriptor>, desc: Handle<PropertyDescriptor>,
result: *mut ObjectOpResult) result: *mut ObjectOpResult)
-> bool { -> bool {
// FIXME: Workaround for https://github.com/rust-lang/rfcs/issues/718 // FIXME: Workaround for https://github.com/rust-lang/rfcs/issues/718
@ -67,7 +66,7 @@ pub unsafe extern "C" fn define_property(cx: *mut JSContext,
} }
let expando = RootedObject::new(cx, ensure_expando_object(cx, proxy)); let expando = RootedObject::new(cx, ensure_expando_object(cx, proxy));
JS_DefinePropertyById6(cx, expando.handle(), id, desc, result) JS_DefinePropertyById(cx, expando.handle(), id, desc, result)
} }
/// Deletes an expando off the given `proxy`. /// Deletes an expando off the given `proxy`.
@ -126,7 +125,7 @@ pub fn ensure_expando_object(cx: *mut JSContext, obj: HandleObject) -> *mut JSOb
expando = JS_NewObjectWithGivenProto(cx, ptr::null_mut(), HandleObject::null()); expando = JS_NewObjectWithGivenProto(cx, ptr::null_mut(), HandleObject::null());
assert!(!expando.is_null()); assert!(!expando.is_null());
SetProxyExtra(obj.get(), JSPROXYSLOT_EXPANDO, ObjectValue(&*expando)); SetProxyExtra(obj.get(), JSPROXYSLOT_EXPANDO, &ObjectValue(&*expando));
} }
expando expando
} }
@ -134,7 +133,7 @@ pub fn ensure_expando_object(cx: *mut JSContext, obj: HandleObject) -> *mut JSOb
/// Set the property descriptor's object to `obj` and set it to enumerable, /// Set the property descriptor's object to `obj` and set it to enumerable,
/// and writable if `readonly` is true. /// and writable if `readonly` is true.
pub fn fill_property_descriptor(desc: &mut JSPropertyDescriptor, pub fn fill_property_descriptor(desc: &mut PropertyDescriptor,
obj: *mut JSObject, obj: *mut JSObject,
attrs: u32) { attrs: u32) {
desc.obj = obj; desc.obj = obj;

View file

@ -33,6 +33,7 @@ use std::cell::RefCell;
use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::hash_map::Entry::{Occupied, Vacant};
use std::collections::hash_map::HashMap; use std::collections::hash_map::HashMap;
use std::marker::PhantomData; use std::marker::PhantomData;
use std::os;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
@ -199,7 +200,7 @@ impl LiveDOMReferences {
/// A JSTraceDataOp for tracing reflectors held in LIVE_REFERENCES /// A JSTraceDataOp for tracing reflectors held in LIVE_REFERENCES
pub unsafe extern "C" fn trace_refcounted_objects(tracer: *mut JSTracer, pub unsafe extern "C" fn trace_refcounted_objects(tracer: *mut JSTracer,
_data: *mut libc::c_void) { _data: *mut os::raw::c_void) {
LIVE_REFERENCES.with(|ref r| { LIVE_REFERENCES.with(|ref r| {
let r = r.borrow(); let r = r.borrow();
let live_references = r.as_ref().unwrap(); let live_references = r.as_ref().unwrap();

View file

@ -7,9 +7,8 @@
use dom::bindings::error::{Error, Fallible}; use dom::bindings::error::{Error, Fallible};
use dom::bindings::global::GlobalRef; use dom::bindings::global::GlobalRef;
use js::glue::JS_STRUCTURED_CLONE_VERSION;
use js::jsapi::{HandleValue, MutableHandleValue}; use js::jsapi::{HandleValue, MutableHandleValue};
use js::jsapi::{JSContext, JS_ReadStructuredClone}; use js::jsapi::{JSContext, JS_ReadStructuredClone, JS_STRUCTURED_CLONE_VERSION};
use js::jsapi::{JS_ClearPendingException, JS_WriteStructuredClone}; use js::jsapi::{JS_ClearPendingException, JS_WriteStructuredClone};
use libc::size_t; use libc::size_t;
use std::ptr; use std::ptr;

View file

@ -49,8 +49,8 @@ use hyper::header::Headers;
use hyper::method::Method; use hyper::method::Method;
use hyper::mime::Mime; use hyper::mime::Mime;
use ipc_channel::ipc::{IpcReceiver, IpcSender}; use ipc_channel::ipc::{IpcReceiver, IpcSender};
use js::jsapi::JS_CallUnbarrieredObjectTracer; use js::glue::{CallObjectTracer, CallUnbarrieredObjectTracer, CallValueTracer};
use js::jsapi::{GCTraceKindToAscii, Heap, JSGCTraceKind, JSObject, JSTracer, JS_CallObjectTracer, JS_CallValueTracer}; use js::jsapi::{GCTraceKindToAscii, Heap, TraceKind, JSObject, JSTracer};
use js::jsval::JSVal; use js::jsval::JSVal;
use js::rust::Runtime; use js::rust::Runtime;
use layout_interface::{LayoutChan, LayoutRPC}; use layout_interface::{LayoutChan, LayoutRPC};
@ -72,7 +72,6 @@ use smallvec::SmallVec;
use std::boxed::FnBox; use std::boxed::FnBox;
use std::cell::{Cell, UnsafeCell}; use std::cell::{Cell, UnsafeCell};
use std::collections::{BTreeMap, HashMap, HashSet}; use std::collections::{BTreeMap, HashMap, HashSet};
use std::ffi::CString;
use std::hash::{BuildHasher, Hash}; use std::hash::{BuildHasher, Hash};
use std::intrinsics::return_address; use std::intrinsics::return_address;
use std::iter::{FromIterator, IntoIterator}; use std::iter::{FromIterator, IntoIterator};
@ -114,14 +113,10 @@ pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: &Heap<JSVal>)
return; return;
} }
let name = CString::new(description).unwrap();
(*tracer).debugPrinter_ = None;
(*tracer).debugPrintIndex_ = !0;
(*tracer).debugPrintArg_ = name.as_ptr() as *const libc::c_void;
debug!("tracing value {}", description); debug!("tracing value {}", description);
JS_CallValueTracer(tracer, CallValueTracer(tracer,
val.ptr.get() as *mut _, val.ptr.get() as *mut _,
GCTraceKindToAscii(val.get().trace_kind())); GCTraceKindToAscii(val.get().trace_kind()));
} }
} }
@ -129,28 +124,20 @@ pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: &Heap<JSVal>)
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Reflector) { pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Reflector) {
unsafe { unsafe {
let name = CString::new(description).unwrap();
(*tracer).debugPrinter_ = None;
(*tracer).debugPrintIndex_ = !0;
(*tracer).debugPrintArg_ = name.as_ptr() as *const libc::c_void;
debug!("tracing reflector {}", description); debug!("tracing reflector {}", description);
JS_CallUnbarrieredObjectTracer(tracer, CallUnbarrieredObjectTracer(tracer,
reflector.rootable(), reflector.rootable(),
GCTraceKindToAscii(JSGCTraceKind::JSTRACE_OBJECT)); GCTraceKindToAscii(TraceKind::Object));
} }
} }
/// Trace a `JSObject`. /// Trace a `JSObject`.
pub fn trace_object(tracer: *mut JSTracer, description: &str, obj: &Heap<*mut JSObject>) { pub fn trace_object(tracer: *mut JSTracer, description: &str, obj: &Heap<*mut JSObject>) {
unsafe { unsafe {
let name = CString::new(description).unwrap();
(*tracer).debugPrinter_ = None;
(*tracer).debugPrintIndex_ = !0;
(*tracer).debugPrintArg_ = name.as_ptr() as *const libc::c_void;
debug!("tracing {}", description); debug!("tracing {}", description);
JS_CallObjectTracer(tracer, CallObjectTracer(tracer,
obj.ptr.get() as *mut _, obj.ptr.get() as *mut _,
GCTraceKindToAscii(JSGCTraceKind::JSTRACE_OBJECT)); GCTraceKindToAscii(TraceKind::Object));
} }
} }

View file

@ -7,13 +7,11 @@
use dom::bindings::codegen::InterfaceObjectMap; use dom::bindings::codegen::InterfaceObjectMap;
use dom::bindings::codegen::PrototypeList; use dom::bindings::codegen::PrototypeList;
use dom::bindings::codegen::PrototypeList::{MAX_PROTO_CHAIN_LENGTH, PROTO_OR_IFACE_LENGTH}; use dom::bindings::codegen::PrototypeList::{MAX_PROTO_CHAIN_LENGTH, PROTO_OR_IFACE_LENGTH};
use dom::bindings::conversions::{DOM_OBJECT_SLOT, is_dom_class}; use dom::bindings::conversions::{DOM_OBJECT_SLOT, is_dom_class, private_from_proto_check};
use dom::bindings::conversions::{private_from_proto_check, root_from_handleobject};
use dom::bindings::error::throw_invalid_this; use dom::bindings::error::throw_invalid_this;
use dom::bindings::inheritance::TopTypeId; use dom::bindings::inheritance::TopTypeId;
use dom::bindings::trace::trace_object; use dom::bindings::trace::trace_object;
use dom::browsingcontext; use dom::browsingcontext;
use dom::window;
use heapsize::HeapSizeOf; use heapsize::HeapSizeOf;
use js; use js;
use js::glue::{CallJitGetterOp, CallJitMethodOp, CallJitSetterOp, IsWrapper}; use js::glue::{CallJitGetterOp, CallJitMethodOp, CallJitSetterOp, IsWrapper};
@ -23,15 +21,14 @@ use js::glue::{RUST_JSID_TO_INT, RUST_JSID_TO_STRING, UnwrapObject};
use js::jsapi::{CallArgs, CompartmentOptions, DOMCallbacks, GetGlobalForObjectCrossCompartment}; use js::jsapi::{CallArgs, CompartmentOptions, DOMCallbacks, GetGlobalForObjectCrossCompartment};
use js::jsapi::{HandleId, HandleObject, HandleValue, Heap, JSAutoCompartment, JSClass, JSContext}; use js::jsapi::{HandleId, HandleObject, HandleValue, Heap, JSAutoCompartment, JSClass, JSContext};
use js::jsapi::{JSJitInfo, JSObject, JSTraceOp, JSTracer, JSVersion, JSWrapObjectCallbacks}; use js::jsapi::{JSJitInfo, JSObject, JSTraceOp, JSTracer, JSVersion, JSWrapObjectCallbacks};
use js::jsapi::{JS_DeletePropertyById1, JS_EnumerateStandardClasses, JS_FireOnNewGlobalObject}; use js::jsapi::{JS_DeletePropertyById, JS_EnumerateStandardClasses, JS_FireOnNewGlobalObject};
use js::jsapi::{JS_ForwardGetPropertyTo, JS_GetClass, JS_GetLatin1StringCharsAndLength}; use js::jsapi::{JS_ForwardGetPropertyTo, JS_GetClass, JS_GetLatin1StringCharsAndLength};
use js::jsapi::{JS_GetProperty, JS_GetPrototype, JS_GetReservedSlot, JS_HasProperty}; use js::jsapi::{JS_GetProperty, JS_GetPrototype, JS_GetReservedSlot, JS_HasProperty};
use js::jsapi::{JS_HasPropertyById, JS_IsExceptionPending, JS_IsGlobalObject, JS_NewGlobalObject}; use js::jsapi::{JS_HasPropertyById, JS_IsExceptionPending, JS_IsGlobalObject, JS_NewGlobalObject};
use js::jsapi::{JS_ObjectToOuterObject, JS_ResolveStandardClass, JS_SetProperty}; use js::jsapi::{JS_ResolveStandardClass, JS_SetProperty, ToWindowProxyIfWindow};
use js::jsapi::{JS_SetReservedSlot, JS_StringHasLatin1Chars, MutableHandleValue, ObjectOpResult}; use js::jsapi::{JS_SetReservedSlot, JS_StringHasLatin1Chars, MutableHandleValue, ObjectOpResult};
use js::jsapi::{OnNewGlobalHookOption, RootedObject}; use js::jsapi::{OnNewGlobalHookOption, RootedObject, RootedValue};
use js::jsval::{JSVal}; use js::jsval::{JSVal, ObjectValue, PrivateValue, UndefinedValue};
use js::jsval::{PrivateValue, UndefinedValue};
use js::rust::{GCMethods, ToString}; use js::rust::{GCMethods, ToString};
use js::{JS_CALLEE}; use js::{JS_CALLEE};
use libc; use libc;
@ -153,7 +150,8 @@ pub fn get_property_on_prototype(cx: *mut JSContext,
return true; return true;
} }
JS_ForwardGetPropertyTo(cx, proto.handle(), id, proxy, vp) let receiver = RootedValue::new(cx, ObjectValue(&**proxy.ptr));
JS_ForwardGetPropertyTo(cx, proto.handle(), id, receiver.handle(), vp)
} }
} }
@ -209,7 +207,7 @@ pub fn is_platform_object(obj: *mut JSObject) -> bool {
} }
// Now for simplicity check for security wrappers before anything else // Now for simplicity check for security wrappers before anything else
if IsWrapper(obj) { if IsWrapper(obj) {
let unwrapped_obj = UnwrapObject(obj, /* stopAtOuter = */ 0); let unwrapped_obj = UnwrapObject(obj, /* stopAtWindowProxy = */ 0);
if unwrapped_obj.is_null() { if unwrapped_obj.is_null() {
return false; return false;
} }
@ -303,8 +301,9 @@ pub fn create_dom_global(cx: *mut JSContext,
-> *mut JSObject { -> *mut JSObject {
unsafe { unsafe {
let mut options = CompartmentOptions::default(); let mut options = CompartmentOptions::default();
options.version_ = JSVersion::JSVERSION_ECMA_5; options.behaviors_.version_ = JSVersion::JSVERSION_ECMA_5;
options.traceGlobal_ = trace; options.creationOptions_.traceGlobal_ = trace;
options.creationOptions_.sharedMemoryAndAtomics_ = true;
let obj = let obj =
RootedObject::new(cx, RootedObject::new(cx,
@ -339,9 +338,7 @@ pub unsafe fn finalize_global(obj: *mut JSObject) {
for idx in 0..PROTO_OR_IFACE_LENGTH as isize { for idx in 0..PROTO_OR_IFACE_LENGTH as isize {
let entry = list.offset(idx); let entry = list.offset(idx);
let value = *entry; let value = *entry;
if <*mut JSObject>::needs_post_barrier(value) { <*mut JSObject>::post_barrier(entry, value, ptr::null_mut());
<*mut JSObject>::relocate(entry);
}
} }
let _: Box<ProtoOrIfaceArray> = Box::from_raw(protolist); let _: Box<ProtoOrIfaceArray> = Box::from_raw(protolist);
} }
@ -423,7 +420,9 @@ unsafe extern "C" fn pre_wrap(cx: *mut JSContext,
_object_passed_to_wrap: HandleObject) _object_passed_to_wrap: HandleObject)
-> *mut JSObject { -> *mut JSObject {
let _ac = JSAutoCompartment::new(cx, obj.get()); let _ac = JSAutoCompartment::new(cx, obj.get());
JS_ObjectToOuterObject(cx, obj) let obj = ToWindowProxyIfWindow(obj.get());
assert!(!obj.is_null());
obj
} }
/// Callback table for use with JS_SetWrapObjectCallbacks /// Callback table for use with JS_SetWrapObjectCallbacks
@ -432,21 +431,13 @@ pub static WRAP_CALLBACKS: JSWrapObjectCallbacks = JSWrapObjectCallbacks {
preWrap: Some(pre_wrap), preWrap: Some(pre_wrap),
}; };
/// Callback to outerize windows.
pub unsafe extern "C" fn outerize_global(_cx: *mut JSContext, obj: HandleObject) -> *mut JSObject {
debug!("outerizing");
let win = root_from_handleobject::<window::Window>(obj).unwrap();
let context = win.browsing_context();
context.window_proxy()
}
/// Deletes the property `id` from `object`. /// Deletes the property `id` from `object`.
pub unsafe fn delete_property_by_id(cx: *mut JSContext, pub unsafe fn delete_property_by_id(cx: *mut JSContext,
object: HandleObject, object: HandleObject,
id: HandleId, id: HandleId,
bp: *mut ObjectOpResult) bp: *mut ObjectOpResult)
-> bool { -> bool {
JS_DeletePropertyById1(cx, object, id, bp) JS_DeletePropertyById(cx, object, id, bp)
} }
unsafe fn generic_call(cx: *mut JSContext, unsafe fn generic_call(cx: *mut JSContext,

View file

@ -12,15 +12,15 @@ use dom::bindings::utils::get_array_index_from_id;
use dom::document::Document; use dom::document::Document;
use dom::element::Element; use dom::element::Element;
use dom::window::Window; use dom::window::Window;
use js::JSCLASS_IS_GLOBAL;
use js::glue::{CreateWrapperProxyHandler, ProxyTraps, NewWindowProxy}; use js::glue::{CreateWrapperProxyHandler, ProxyTraps, NewWindowProxy};
use js::glue::{GetProxyPrivate, SetProxyExtra}; use js::glue::{GetProxyPrivate, SetProxyExtra};
use js::jsapi::{Handle, HandleId, HandleObject, JSAutoCompartment, JSAutoRequest, JSContext}; use js::jsapi::{Handle, HandleId, HandleObject, HandleValue, JSAutoCompartment, JSAutoRequest};
use js::jsapi::{JSErrNum, JSObject, JSPropertyDescriptor, JS_DefinePropertyById6}; use js::jsapi::{JSContext, JSPROP_READONLY, JSErrNum, JSObject, PropertyDescriptor, JS_DefinePropertyById};
use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo, JS_GetClass}; use js::jsapi::{JS_ForwardGetPropertyTo, JS_ForwardSetPropertyTo, JS_GetClass};
use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_HasPropertyById, MutableHandle}; use js::jsapi::{JS_GetOwnPropertyDescriptorById, JS_HasPropertyById, MutableHandle};
use js::jsapi::{MutableHandleValue, ObjectOpResult, RootedObject, RootedValue}; use js::jsapi::{MutableHandleValue, ObjectOpResult, RootedObject, RootedValue};
use js::jsval::{ObjectValue, UndefinedValue, PrivateValue}; use js::jsval::{UndefinedValue, PrivateValue};
use js::{JSCLASS_IS_GLOBAL, JSPROP_READONLY};
#[dom_struct] #[dom_struct]
pub struct BrowsingContext { pub struct BrowsingContext {
@ -59,7 +59,7 @@ impl BrowsingContext {
let object = box BrowsingContext::new_inherited(frame_element); let object = box BrowsingContext::new_inherited(frame_element);
let raw = Box::into_raw(object); let raw = Box::into_raw(object);
SetProxyExtra(window_proxy.ptr, 0, PrivateValue(raw as *const _)); SetProxyExtra(window_proxy.ptr, 0, &PrivateValue(raw as *const _));
(*raw).init_reflector(window_proxy.ptr); (*raw).init_reflector(window_proxy.ptr);
@ -131,7 +131,7 @@ unsafe fn GetSubframeWindow(cx: *mut JSContext,
unsafe extern "C" fn getOwnPropertyDescriptor(cx: *mut JSContext, unsafe extern "C" fn getOwnPropertyDescriptor(cx: *mut JSContext,
proxy: HandleObject, proxy: HandleObject,
id: HandleId, id: HandleId,
desc: MutableHandle<JSPropertyDescriptor>) desc: MutableHandle<PropertyDescriptor>)
-> bool { -> bool {
let window = GetSubframeWindow(cx, proxy, id); let window = GetSubframeWindow(cx, proxy, id);
if let Some(window) = window { if let Some(window) = window {
@ -159,7 +159,7 @@ unsafe extern "C" fn getOwnPropertyDescriptor(cx: *mut JSContext,
unsafe extern "C" fn defineProperty(cx: *mut JSContext, unsafe extern "C" fn defineProperty(cx: *mut JSContext,
proxy: HandleObject, proxy: HandleObject,
id: HandleId, id: HandleId,
desc: Handle<JSPropertyDescriptor>, desc: Handle<PropertyDescriptor>,
res: *mut ObjectOpResult) res: *mut ObjectOpResult)
-> bool { -> bool {
if get_array_index_from_id(cx, id).is_some() { if get_array_index_from_id(cx, id).is_some() {
@ -172,7 +172,7 @@ unsafe extern "C" fn defineProperty(cx: *mut JSContext,
} }
let target = RootedObject::new(cx, GetProxyPrivate(*proxy.ptr).to_object()); let target = RootedObject::new(cx, GetProxyPrivate(*proxy.ptr).to_object());
JS_DefinePropertyById6(cx, target.handle(), id, desc, res) JS_DefinePropertyById(cx, target.handle(), id, desc, res)
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]
@ -200,7 +200,7 @@ unsafe extern "C" fn has(cx: *mut JSContext,
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe extern "C" fn get(cx: *mut JSContext, unsafe extern "C" fn get(cx: *mut JSContext,
proxy: HandleObject, proxy: HandleObject,
receiver: HandleObject, receiver: HandleValue,
id: HandleId, id: HandleId,
vp: MutableHandleValue) vp: MutableHandleValue)
-> bool { -> bool {
@ -217,9 +217,9 @@ unsafe extern "C" fn get(cx: *mut JSContext,
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe extern "C" fn set(cx: *mut JSContext, unsafe extern "C" fn set(cx: *mut JSContext,
proxy: HandleObject, proxy: HandleObject,
receiver: HandleObject,
id: HandleId, id: HandleId,
vp: MutableHandleValue, v: HandleValue,
receiver: HandleValue,
res: *mut ObjectOpResult) res: *mut ObjectOpResult)
-> bool { -> bool {
if get_array_index_from_id(cx, id).is_some() { if get_array_index_from_id(cx, id).is_some() {
@ -229,12 +229,11 @@ unsafe extern "C" fn set(cx: *mut JSContext,
} }
let target = RootedObject::new(cx, GetProxyPrivate(*proxy.ptr).to_object()); let target = RootedObject::new(cx, GetProxyPrivate(*proxy.ptr).to_object());
let receiver = RootedValue::new(cx, ObjectValue(&**receiver.ptr));
JS_ForwardSetPropertyTo(cx, JS_ForwardSetPropertyTo(cx,
target.handle(), target.handle(),
id, id,
vp.to_handle(), v,
receiver.handle(), receiver,
res) res)
} }

View file

@ -39,7 +39,9 @@ impl ImageData {
let js_object: *mut JSObject = JS_NewUint8ClampedArray(cx, width * height * 4); let js_object: *mut JSObject = JS_NewUint8ClampedArray(cx, width * height * 4);
if let Some(vec) = data { if let Some(vec) = data {
let js_object_data: *mut uint8_t = JS_GetUint8ClampedArrayData(js_object, ptr::null()); let mut is_shared = false;
let js_object_data: *mut uint8_t = JS_GetUint8ClampedArrayData(js_object, &mut is_shared, ptr::null());
assert!(!is_shared);
ptr::copy_nonoverlapping(vec.as_ptr(), js_object_data, vec.len()) ptr::copy_nonoverlapping(vec.as_ptr(), js_object_data, vec.len())
} }
(*imagedata).data.set(js_object); (*imagedata).data.set(js_object);
@ -53,7 +55,10 @@ impl ImageData {
pub fn get_data_array(&self, global: &GlobalRef) -> Vec<u8> { pub fn get_data_array(&self, global: &GlobalRef) -> Vec<u8> {
unsafe { unsafe {
let cx = global.get_cx(); let cx = global.get_cx();
let data: *const uint8_t = JS_GetUint8ClampedArrayData(self.Data(cx), ptr::null()) as *const uint8_t; let mut is_shared = false;
let data: *const uint8_t =
JS_GetUint8ClampedArrayData(self.Data(cx), &mut is_shared, ptr::null()) as *const uint8_t;
assert!(!is_shared);
let len = self.Width() * self.Height() * 4; let len = self.Width() * self.Height() * 4;
slice::from_raw_parts(data, len as usize).to_vec() slice::from_raw_parts(data, len as usize).to_vec()
} }

View file

@ -76,8 +76,9 @@ impl TextEncoderMethods for TextEncoder {
let encoded = self.encoder.encode(&input.0, EncoderTrap::Strict).unwrap(); let encoded = self.encoder.encode(&input.0, EncoderTrap::Strict).unwrap();
let length = encoded.len() as u32; let length = encoded.len() as u32;
let js_object: *mut JSObject = JS_NewUint8Array(cx, length); let js_object: *mut JSObject = JS_NewUint8Array(cx, length);
let mut is_shared = false;
let js_object_data: *mut uint8_t = JS_GetUint8ArrayData(js_object, ptr::null()); let js_object_data: *mut uint8_t = JS_GetUint8ArrayData(js_object, &mut is_shared, ptr::null());
assert!(!is_shared);
ptr::copy_nonoverlapping(encoded.as_ptr(), js_object_data, length as usize); ptr::copy_nonoverlapping(encoded.as_ptr(), js_object_data, length as usize);
js_object js_object
} }

View file

@ -604,7 +604,9 @@ impl Runnable for MessageReceivedTask {
BinaryType::Arraybuffer => { BinaryType::Arraybuffer => {
let len = data.len() as uint32_t; let len = data.len() as uint32_t;
let buf = JS_NewArrayBuffer(cx, len); let buf = JS_NewArrayBuffer(cx, len);
let buf_data: *mut uint8_t = JS_GetArrayBufferData(buf, ptr::null()); let mut is_shared = false;
let buf_data: *mut uint8_t = JS_GetArrayBufferData(buf, &mut is_shared, ptr::null());
assert!(!is_shared);
ptr::copy_nonoverlapping(data.as_ptr(), buf_data, len as usize); ptr::copy_nonoverlapping(data.as_ptr(), buf_data, len as usize);
buf.to_jsval(cx, message.handle_mut()); buf.to_jsval(cx, message.handle_mut());
} }

View file

@ -37,7 +37,7 @@ use gfx_traits::LayerId;
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use js::jsapi::{Evaluate2, MutableHandleValue}; use js::jsapi::{Evaluate2, MutableHandleValue};
use js::jsapi::{HandleValue, JSContext}; use js::jsapi::{HandleValue, JSContext};
use js::jsapi::{JSAutoCompartment, JSAutoRequest, JS_GC, JS_GetRuntime}; use js::jsapi::{JSAutoCompartment, JSAutoRequest, JS_GC, JS_GetRuntime, SetWindowProxy};
use js::rust::CompileOptionsWrapper; use js::rust::CompileOptionsWrapper;
use js::rust::Runtime; use js::rust::Runtime;
use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow}; use layout_interface::{ContentBoxResponse, ContentBoxesResponse, ResolvedStyleResponse, ScriptReflow};
@ -1192,9 +1192,15 @@ impl Window {
self.layout_rpc.margin_style() self.layout_rpc.margin_style()
} }
#[allow(unsafe_code)]
pub fn init_browsing_context(&self, browsing_context: &BrowsingContext) { pub fn init_browsing_context(&self, browsing_context: &BrowsingContext) {
assert!(self.browsing_context.get().is_none()); assert!(self.browsing_context.get().is_none());
self.browsing_context.set(Some(&browsing_context)); self.browsing_context.set(Some(&browsing_context));
let window = self.reflector().get_jsobject();
let cx = self.get_cx();
let _ar = JSAutoRequest::new(cx);
let _ac = JSAutoCompartment::new(cx, window.get());
unsafe { SetWindowProxy(cx, window, browsing_context.reflector().get_jsobject()); }
} }
/// Commence a new URL load which will either replace this window or scroll to a fragment. /// Commence a new URL load which will either replace this window or scroll to a fragment.

View file

@ -18,7 +18,8 @@ use dom::window::{base64_atob, base64_btoa};
use dom::workerlocation::WorkerLocation; use dom::workerlocation::WorkerLocation;
use dom::workernavigator::WorkerNavigator; use dom::workernavigator::WorkerNavigator;
use ipc_channel::ipc::IpcSender; use ipc_channel::ipc::IpcSender;
use js::jsapi::{HandleValue, JSAutoRequest, JSContext, JSRuntime}; use js::jsapi::{HandleValue, JSAutoRequest, JSContext, JSRuntime, RootedValue};
use js::jsval::UndefinedValue;
use js::rust::Runtime; use js::rust::Runtime;
use msg::constellation_msg::{ConstellationChan, PipelineId}; use msg::constellation_msg::{ConstellationChan, PipelineId};
use net_traits::{LoadContext, ResourceThread, load_whole_resource}; use net_traits::{LoadContext, ResourceThread, load_whole_resource};
@ -216,6 +217,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
}; };
} }
let mut rval = RootedValue::new(self.runtime.cx(), UndefinedValue());
for url in urls { for url in urls {
let (url, source) = match load_whole_resource(LoadContext::Script, &self.resource_thread, url, None) { let (url, source) = match load_whole_resource(LoadContext::Script, &self.resource_thread, url, None) {
Err(_) => return Err(Error::Network), Err(_) => return Err(Error::Network),
@ -225,7 +227,7 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
}; };
match self.runtime.evaluate_script( match self.runtime.evaluate_script(
self.reflector().get_jsobject(), source, url.to_string(), 1) { self.reflector().get_jsobject(), &source, url.as_str(), 1, rval.handle_mut()) {
Ok(_) => (), Ok(_) => (),
Err(_) => { Err(_) => {
println!("evaluate_script failed"); println!("evaluate_script failed");
@ -316,8 +318,9 @@ impl WorkerGlobalScopeMethods for WorkerGlobalScope {
impl WorkerGlobalScope { impl WorkerGlobalScope {
pub fn execute_script(&self, source: DOMString) { pub fn execute_script(&self, source: DOMString) {
let mut rval = RootedValue::new(self.runtime.cx(), UndefinedValue());
match self.runtime.evaluate_script( match self.runtime.evaluate_script(
self.reflector().get_jsobject(), String::from(source), self.worker_url.to_string(), 1) { self.reflector().get_jsobject(), &source, self.worker_url.as_str(), 1, rval.handle_mut()) {
Ok(_) => (), Ok(_) => (),
Err(_) => { Err(_) => {
if self.is_closing() { if self.is_closing() {

View file

@ -17,12 +17,12 @@ use js::jsapi::{JSGCMode, JSGCParamKey, JS_SetGCParameter, JS_SetGlobalJitCompil
use js::jsapi::{JSJitCompilerOption, JS_SetOffthreadIonCompilationEnabled, JS_SetParallelParsingEnabled}; use js::jsapi::{JSJitCompilerOption, JS_SetOffthreadIonCompilationEnabled, JS_SetParallelParsingEnabled};
use js::jsapi::{JSObject, RuntimeOptionsRef, SetPreserveWrapperCallback}; use js::jsapi::{JSObject, RuntimeOptionsRef, SetPreserveWrapperCallback};
use js::rust::Runtime; use js::rust::Runtime;
use libc;
use profile_traits::mem::{Report, ReportKind, ReportsChan}; use profile_traits::mem::{Report, ReportKind, ReportsChan};
use script_thread::{Runnable, STACK_ROOTS, trace_thread}; use script_thread::{Runnable, STACK_ROOTS, trace_thread};
use std::cell::Cell; use std::cell::Cell;
use std::io::{Write, stdout}; use std::io::{Write, stdout};
use std::marker::PhantomData; use std::marker::PhantomData;
use std::os;
use std::ptr; use std::ptr;
use time::{Tm, now}; use time::{Tm, now};
use util::opts; use util::opts;
@ -362,7 +362,7 @@ unsafe extern "C" fn gc_slice_callback(_rt: *mut JSRuntime, progress: GCProgress
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe extern "C" fn debug_gc_callback(_rt: *mut JSRuntime, status: JSGCStatus, _data: *mut libc::c_void) { unsafe extern "C" fn debug_gc_callback(_rt: *mut JSRuntime, status: JSGCStatus, _data: *mut os::raw::c_void) {
match status { match status {
JSGCStatus::JSGC_BEGIN => thread_state::enter(thread_state::IN_GC), JSGCStatus::JSGC_BEGIN => thread_state::enter(thread_state::IN_GC),
JSGCStatus::JSGC_END => thread_state::exit(thread_state::IN_GC), JSGCStatus::JSGC_END => thread_state::exit(thread_state::IN_GC),
@ -370,7 +370,7 @@ unsafe extern "C" fn debug_gc_callback(_rt: *mut JSRuntime, status: JSGCStatus,
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]
unsafe extern fn trace_rust_roots(tr: *mut JSTracer, _data: *mut libc::c_void) { unsafe extern fn trace_rust_roots(tr: *mut JSTracer, _data: *mut os::raw::c_void) {
trace_thread(tr); trace_thread(tr);
trace_traceables(tr); trace_traceables(tr);
trace_roots(tr); trace_roots(tr);

View file

@ -51,9 +51,9 @@ use hyper::method::Method;
use hyper::mime::{Mime, SubLevel, TopLevel}; use hyper::mime::{Mime, SubLevel, TopLevel};
use ipc_channel::ipc::{self, IpcSender}; use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER; use ipc_channel::router::ROUTER;
use js::glue::GetWindowProxyClass;
use js::jsapi::{DOMProxyShadowsResult, HandleId, HandleObject, RootedValue}; use js::jsapi::{DOMProxyShadowsResult, HandleId, HandleObject, RootedValue};
use js::jsapi::{JSAutoRequest, JS_SetWrapObjectCallbacks}; use js::jsapi::{JSAutoRequest, JSContext, JS_SetWrapObjectCallbacks, JSTracer, SetWindowProxyClass};
use js::jsapi::{JSContext, JSTracer};
use js::jsval::UndefinedValue; use js::jsval::UndefinedValue;
use js::rust::Runtime; use js::rust::Runtime;
use layout_interface::{ReflowQueryType}; use layout_interface::{ReflowQueryType};
@ -515,6 +515,7 @@ impl ScriptThread {
unsafe { unsafe {
JS_SetWrapObjectCallbacks(runtime.rt(), JS_SetWrapObjectCallbacks(runtime.rt(),
&WRAP_CALLBACKS); &WRAP_CALLBACKS);
SetWindowProxyClass(runtime.rt(), GetWindowProxyClass());
} }
// Ask the router to proxy IPC messages from the devtools to us. // Ask the router to proxy IPC messages from the devtools to us.

View file

@ -1018,13 +1018,13 @@ dependencies = [
[[package]] [[package]]
name = "js" name = "js"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/servo/rust-mozjs#efe805affa75d776316e9ea6113f85cdad1e82ed" source = "git+https://github.com/servo/rust-mozjs#8ad6c1148fd77e5b9dc2ce0f0ab40d4f455f6f4e"
dependencies = [ dependencies = [
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
"num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1274,7 +1274,7 @@ dependencies = [
[[package]] [[package]]
name = "mozjs_sys" name = "mozjs_sys"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/mozjs#3122a1e1a80b78377ae1ce8e7edd4ad3bcbb3d65" source = "git+https://github.com/servo/mozjs#2af5849a97a9f18acd482940ba3fa0c6797ed7eb"
dependencies = [ dependencies = [
"libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",

6
ports/cef/Cargo.lock generated
View file

@ -939,13 +939,13 @@ dependencies = [
[[package]] [[package]]
name = "js" name = "js"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/servo/rust-mozjs#efe805affa75d776316e9ea6113f85cdad1e82ed" source = "git+https://github.com/servo/rust-mozjs#8ad6c1148fd77e5b9dc2ce0f0ab40d4f455f6f4e"
dependencies = [ dependencies = [
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
"num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1188,7 +1188,7 @@ dependencies = [
[[package]] [[package]]
name = "mozjs_sys" name = "mozjs_sys"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/mozjs#3122a1e1a80b78377ae1ce8e7edd4ad3bcbb3d65" source = "git+https://github.com/servo/mozjs#2af5849a97a9f18acd482940ba3fa0c6797ed7eb"
dependencies = [ dependencies = [
"libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",

6
ports/gonk/Cargo.lock generated
View file

@ -922,13 +922,13 @@ dependencies = [
[[package]] [[package]]
name = "js" name = "js"
version = "0.1.2" version = "0.1.2"
source = "git+https://github.com/servo/rust-mozjs#efe805affa75d776316e9ea6113f85cdad1e82ed" source = "git+https://github.com/servo/rust-mozjs#8ad6c1148fd77e5b9dc2ce0f0ab40d4f455f6f4e"
dependencies = [ dependencies = [
"heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)", "mozjs_sys 0.0.0 (git+https://github.com/servo/mozjs)",
"num 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -1171,7 +1171,7 @@ dependencies = [
[[package]] [[package]]
name = "mozjs_sys" name = "mozjs_sys"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/mozjs#3122a1e1a80b78377ae1ce8e7edd4ad3bcbb3d65" source = "git+https://github.com/servo/mozjs#2af5849a97a9f18acd482940ba3fa0c6797ed7eb"
dependencies = [ dependencies = [
"libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",

View file

@ -28,7 +28,6 @@ var ecmaGlobals = [
"Int32Array", "Int32Array",
"Int8Array", "Int8Array",
"InternalError", "InternalError",
"Intl",
"Iterator", "Iterator",
"JSON", "JSON",
"Map", "Map",
@ -39,19 +38,11 @@ var ecmaGlobals = [
"Proxy", "Proxy",
"RangeError", "RangeError",
"ReferenceError", "ReferenceError",
"Reflect",
"RegExp", "RegExp",
"SIMD", "SIMD",
"Set", "Set",
"SharedArrayBuffer", "SharedArrayBuffer",
"SharedFloat32Array",
"SharedFloat64Array",
"SharedInt16Array",
"SharedInt32Array",
"SharedInt8Array",
"SharedUint16Array",
"SharedUint32Array",
"SharedUint8Array",
"SharedUint8ClampedArray",
"StopIteration", "StopIteration",
"String", "String",
"Symbol", "Symbol",