Backed out changeset 7701bd27ec28 (bug 1239605) for failing M(12) tests on Android. r=bustage

This commit is contained in:
Sebastian Hengst 2016-01-15 17:52:20 +01:00
parent 10861d12e0
commit 1324d8e446
3 changed files with 16 additions and 26 deletions

View File

@ -1048,6 +1048,15 @@ static const JSStdName builtin_property_names[] = {
#if JS_HAS_UNEVAL #if JS_HAS_UNEVAL
{ EAGER_ATOM(uneval), JSProto_String }, { EAGER_ATOM(uneval), JSProto_String },
#endif #endif
#ifdef ENABLE_SIMD
{ EAGER_ATOM(SIMD), JSProto_SIMD },
#endif
#ifdef ENABLE_BINARYDATA
{ EAGER_ATOM(TypedObject), JSProto_TypedObject },
#endif
#ifdef ENABLE_SHARED_ARRAY_BUFFER
{ EAGER_ATOM(Atomics), JSProto_Atomics },
#endif
{ 0, JSProto_LIMIT } { 0, JSProto_LIMIT }
}; };
@ -1087,8 +1096,14 @@ JS_ResolveStandardClass(JSContext* cx, HandleObject obj, HandleId id, bool* reso
if (!stdnm) if (!stdnm)
stdnm = LookupStdName(cx->names(), idAtom, builtin_property_names); stdnm = LookupStdName(cx->names(), idAtom, builtin_property_names);
if (stdnm && GlobalObject::skipDeselectedConstructor(cx, stdnm->key)) #ifdef ENABLE_SHARED_ARRAY_BUFFER
if (stdnm && !cx->compartment()->creationOptions().getSharedMemoryAndAtomicsEnabled() &&
(stdnm->atomOffset == NAME_OFFSET(Atomics) ||
stdnm->atomOffset == NAME_OFFSET(SharedArrayBuffer)))
{
stdnm = nullptr; stdnm = nullptr;
}
#endif
// If this class is anonymous, then it doesn't exist as a global // If this class is anonymous, then it doesn't exist as a global
// property, so we won't resolve anything. // property, so we won't resolve anything.
@ -1131,9 +1146,6 @@ JS_MayResolveStandardClass(const JSAtomState& names, jsid id, JSObject* maybeObj
JSAtom* atom = JSID_TO_ATOM(id); JSAtom* atom = JSID_TO_ATOM(id);
// This will return true even for deselected constructors. (To do
// better, we need a JSContext here; it's fine as it is.)
return atom == names.undefined || return atom == names.undefined ||
LookupStdName(names, atom, standard_class_names) || LookupStdName(names, atom, standard_class_names) ||
LookupStdName(names, atom, builtin_property_names); LookupStdName(names, atom, builtin_property_names);
@ -1190,9 +1202,6 @@ JS_IdToProtoKey(JSContext* cx, HandleId id)
if (!stdnm) if (!stdnm)
return JSProto_Null; return JSProto_Null;
if (GlobalObject::skipDeselectedConstructor(cx, stdnm->key))
return JSProto_Null;
MOZ_ASSERT(MOZ_ARRAY_LENGTH(standard_class_names) == JSProto_LIMIT + 1); MOZ_ASSERT(MOZ_ARRAY_LENGTH(standard_class_names) == JSProto_LIMIT + 1);
return static_cast<JSProtoKey>(stdnm - standard_class_names); return static_cast<JSProtoKey>(stdnm - standard_class_names);
} }

View File

@ -90,21 +90,6 @@ js::GlobalObject::getTypedObjectModule() const {
return v.toObject().as<TypedObjectModuleObject>(); return v.toObject().as<TypedObjectModuleObject>();
} }
/* static */ bool
GlobalObject::skipDeselectedConstructor(JSContext* cx, JSProtoKey key)
{
// Return true if the given constructor has been disabled at run-time.
switch (key) {
#ifdef ENABLE_SHARED_ARRAY_BUFFER
case JSProto_Atomics:
case JSProto_SharedArrayBuffer:
return !cx->compartment()->creationOptions().getSharedMemoryAndAtomicsEnabled();
#endif
default:
return false;
}
}
/* static */ bool /* static */ bool
GlobalObject::ensureConstructor(JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key) GlobalObject::ensureConstructor(JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key)
{ {
@ -130,9 +115,6 @@ GlobalObject::resolveConstructor(JSContext* cx, Handle<GlobalObject*> global, JS
if (!init && !clasp) if (!init && !clasp)
return true; // JSProto_Null or a compile-time-disabled feature. return true; // JSProto_Null or a compile-time-disabled feature.
if (skipDeselectedConstructor(cx, key))
return true;
// Some classes have no init routine, which means that they're disabled at // Some classes have no init routine, which means that they're disabled at
// compile-time. We could try to enforce that callers never pass such keys // compile-time. We could try to enforce that callers never pass such keys
// to resolveConstructor, but that would cramp the style of consumers like // to resolveConstructor, but that would cramp the style of consumers like

View File

@ -163,7 +163,6 @@ class GlobalObject : public NativeObject
MOZ_ASSERT(key <= JSProto_LIMIT); MOZ_ASSERT(key <= JSProto_LIMIT);
return getSlot(APPLICATION_SLOTS + key); return getSlot(APPLICATION_SLOTS + key);
} }
static bool skipDeselectedConstructor(JSContext* cx, JSProtoKey key);
static bool ensureConstructor(JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key); static bool ensureConstructor(JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key);
static bool resolveConstructor(JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key); static bool resolveConstructor(JSContext* cx, Handle<GlobalObject*> global, JSProtoKey key);
static bool initBuiltinConstructor(JSContext* cx, Handle<GlobalObject*> global, static bool initBuiltinConstructor(JSContext* cx, Handle<GlobalObject*> global,