mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 875452 - Part 8: Move GetElementIC to use common CanAttachNative. (r=shu)
This commit is contained in:
parent
7038ea516f
commit
7fa79732eb
@ -2340,15 +2340,14 @@ GetElementIC::attachGetProp(JSContext *cx, IonScript *ion, HandleObject obj,
|
||||
|
||||
RootedObject holder(cx);
|
||||
RootedShape shape(cx);
|
||||
if (!JSObject::lookupProperty(cx, obj, name, &holder, &shape))
|
||||
|
||||
GetPropertyIC::NativeGetPropCacheability canCache =
|
||||
CanAttachNativeGetProp(cx, *this, obj, name, &holder, &shape);
|
||||
|
||||
if (canCache == GetPropertyIC::CanAttachError)
|
||||
return false;
|
||||
|
||||
RootedScript script(cx);
|
||||
jsbytecode *pc;
|
||||
getScriptedLocation(&script, &pc);
|
||||
|
||||
if (!IsCacheableGetPropReadSlot(obj, holder, shape) &&
|
||||
!IsCacheableNoProperty(obj, holder, shape, pc, output())) {
|
||||
if (canCache != GetPropertyIC::CanAttachReadSlot) {
|
||||
IonSpew(IonSpew_InlineCaches, "GETELEM uncacheable property");
|
||||
return true;
|
||||
}
|
||||
|
@ -705,6 +705,18 @@ class GetElementIC : public RepatchIonCache
|
||||
hasDenseStub_ = true;
|
||||
}
|
||||
|
||||
// Helpers for CanAttachNativeGetProp
|
||||
typedef JSContext * Context;
|
||||
static bool doPropertyLookup(Context cx, HandleObject obj, HandlePropertyName name,
|
||||
MutableHandleObject holder, MutableHandleShape shape) {
|
||||
return JSObject::lookupProperty(cx, obj, name, holder, shape);
|
||||
}
|
||||
bool allowGetters() const { return false; }
|
||||
bool lookupNeedsIdempotentChain() const { return false; }
|
||||
bool canMonitorSingletonUndefinedSlot(HandleObject holder, HandleShape shape) const {
|
||||
return monitoredResult();
|
||||
}
|
||||
|
||||
static bool canAttachGetProp(JSObject *obj, const Value &idval, jsid id);
|
||||
static bool canAttachDenseElement(JSObject *obj, const Value &idval);
|
||||
static bool canAttachTypedArrayElement(JSObject *obj, const Value &idval,
|
||||
|
Loading…
Reference in New Issue
Block a user