mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 934526 - Remove unnecessary attempt to instantiate intrinsic values in IonBuilder, r=jandem.
This commit is contained in:
parent
6efba18832
commit
33d73d4879
@ -6371,11 +6371,8 @@ IonBuilder::jsop_intrinsic(PropertyName *name)
|
||||
}
|
||||
|
||||
// Bake in the intrinsic. Make sure that TI agrees with us on the type.
|
||||
RootedPropertyName nameRoot(cx, name);
|
||||
RootedValue vp(cx, UndefinedValue());
|
||||
if (!cx->global()->getIntrinsicValue(cx, nameRoot, &vp))
|
||||
return false;
|
||||
|
||||
Value vp;
|
||||
JS_ALWAYS_TRUE(script()->global().maybeGetIntrinsicValue(name, &vp));
|
||||
JS_ASSERT(types->hasType(types::GetValueType(vp)));
|
||||
|
||||
MConstant *ins = MConstant::New(vp);
|
||||
|
@ -511,13 +511,22 @@ class GlobalObject : public JSObject
|
||||
return &getSlotRef(INTRINSICS).toObject();
|
||||
}
|
||||
|
||||
bool maybeGetIntrinsicValue(PropertyName *name, Value *vp) {
|
||||
JSObject *holder = intrinsicsHolder();
|
||||
if (Shape *shape = holder->nativeLookupPure(name)) {
|
||||
*vp = holder->getSlot(shape->slot());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool getIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue value) {
|
||||
RootedObject holder(cx, intrinsicsHolder());
|
||||
RootedId id(cx, NameToId(name));
|
||||
if (HasDataProperty(cx, holder, id, value.address()))
|
||||
if (maybeGetIntrinsicValue(name, value.address()))
|
||||
return true;
|
||||
if (!cx->runtime()->cloneSelfHostedValue(cx, name, value))
|
||||
return false;
|
||||
RootedObject holder(cx, intrinsicsHolder());
|
||||
RootedId id(cx, NameToId(name));
|
||||
return JS_DefinePropertyById(cx, holder, id, value, nullptr, nullptr, 0);
|
||||
}
|
||||
|
||||
|
@ -1242,10 +1242,7 @@ class ObjectImpl : public gc::BarrieredCell<ObjectImpl>
|
||||
return nativeLookup(cx, shape->propid()) == shape;
|
||||
}
|
||||
|
||||
/*
|
||||
* Contextless; can be called from parallel code. Returns false if the
|
||||
* operation would have been effectful.
|
||||
*/
|
||||
/* Contextless; can be called from parallel code. */
|
||||
Shape *nativeLookupPure(jsid id);
|
||||
Shape *nativeLookupPure(PropertyId pid) {
|
||||
return nativeLookupPure(pid.asId());
|
||||
|
Loading…
Reference in New Issue
Block a user