mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 875452 - Part 7: Move GetPropertyParIC to common CanAttachNative. (r=shu)
This commit is contained in:
parent
8a27992333
commit
62b1972275
@ -1855,19 +1855,23 @@ GetPropertyParIC::update(ForkJoinSlice *slice, size_t cacheIndex,
|
||||
{
|
||||
RootedShape shape(cx);
|
||||
RootedObject holder(cx);
|
||||
if (canAttachReadSlot(cx, cache, cache.output(), obj, cache.name(),
|
||||
&holder, &shape))
|
||||
{
|
||||
RootedPropertyName name(cx, cache.name());
|
||||
|
||||
GetPropertyIC::NativeGetPropCacheability canCache =
|
||||
CanAttachNativeGetProp(cx, cache, obj, name, &holder, &shape);
|
||||
JS_ASSERT(canCache != GetPropertyIC::CanAttachError);
|
||||
|
||||
if (canCache == GetPropertyIC::CanAttachReadSlot) {
|
||||
if (!cache.attachReadSlot(cx, ion, obj, holder, shape))
|
||||
return TP_FATAL;
|
||||
attachedStub = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!attachedStub && obj->is<ArrayObject>() && slice->names().length == cache.name()) {
|
||||
if (!cache.attachArrayLength(cx, ion, obj))
|
||||
return TP_FATAL;
|
||||
attachedStub = true;
|
||||
if (!attachedStub && canCache == GetPropertyIC::CanAttachArrayLength) {
|
||||
if (!cache.attachArrayLength(cx, ion, obj))
|
||||
return TP_FATAL;
|
||||
attachedStub = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!attachedStub && !cache.hasTypedArrayLengthStub() &&
|
||||
|
@ -976,6 +976,16 @@ class GetPropertyParIC : public ParallelIonCache
|
||||
return hasTypedArrayLengthStub_;
|
||||
}
|
||||
|
||||
// CanAttachNativeGetProp Helpers
|
||||
typedef LockedJSContext & Context;
|
||||
static bool doPropertyLookup(Context cx, HandleObject obj, HandlePropertyName name,
|
||||
MutableHandleObject holder, MutableHandleShape shape) {
|
||||
return LookupPropertyPure(obj, NameToId(name), holder.address(), shape.address());
|
||||
}
|
||||
bool lookupNeedsIdempotentChain() const { return true; }
|
||||
bool canMonitorSingletonUndefinedSlot(HandleObject, HandleShape) const { return true; }
|
||||
bool allowGetters() const { return false; }
|
||||
|
||||
static bool canAttachReadSlot(LockedJSContext &cx, IonCache &cache,
|
||||
TypedOrValueRegister output, JSObject *obj,
|
||||
PropertyName *name, MutableHandleObject holder,
|
||||
|
Loading…
Reference in New Issue
Block a user