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.
|
// Bake in the intrinsic. Make sure that TI agrees with us on the type.
|
||||||
RootedPropertyName nameRoot(cx, name);
|
Value vp;
|
||||||
RootedValue vp(cx, UndefinedValue());
|
JS_ALWAYS_TRUE(script()->global().maybeGetIntrinsicValue(name, &vp));
|
||||||
if (!cx->global()->getIntrinsicValue(cx, nameRoot, &vp))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
JS_ASSERT(types->hasType(types::GetValueType(vp)));
|
JS_ASSERT(types->hasType(types::GetValueType(vp)));
|
||||||
|
|
||||||
MConstant *ins = MConstant::New(vp);
|
MConstant *ins = MConstant::New(vp);
|
||||||
|
@ -511,13 +511,22 @@ class GlobalObject : public JSObject
|
|||||||
return &getSlotRef(INTRINSICS).toObject();
|
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) {
|
bool getIntrinsicValue(JSContext *cx, HandlePropertyName name, MutableHandleValue value) {
|
||||||
RootedObject holder(cx, intrinsicsHolder());
|
if (maybeGetIntrinsicValue(name, value.address()))
|
||||||
RootedId id(cx, NameToId(name));
|
|
||||||
if (HasDataProperty(cx, holder, id, value.address()))
|
|
||||||
return true;
|
return true;
|
||||||
if (!cx->runtime()->cloneSelfHostedValue(cx, name, value))
|
if (!cx->runtime()->cloneSelfHostedValue(cx, name, value))
|
||||||
return false;
|
return false;
|
||||||
|
RootedObject holder(cx, intrinsicsHolder());
|
||||||
|
RootedId id(cx, NameToId(name));
|
||||||
return JS_DefinePropertyById(cx, holder, id, value, nullptr, nullptr, 0);
|
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;
|
return nativeLookup(cx, shape->propid()) == shape;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Contextless; can be called from parallel code. */
|
||||||
* Contextless; can be called from parallel code. Returns false if the
|
|
||||||
* operation would have been effectful.
|
|
||||||
*/
|
|
||||||
Shape *nativeLookupPure(jsid id);
|
Shape *nativeLookupPure(jsid id);
|
||||||
Shape *nativeLookupPure(PropertyId pid) {
|
Shape *nativeLookupPure(PropertyId pid) {
|
||||||
return nativeLookupPure(pid.asId());
|
return nativeLookupPure(pid.asId());
|
||||||
|
Loading…
Reference in New Issue
Block a user