summaryrefslogtreecommitdiff
path: root/js/src/jit/BaselineIC.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2022-05-29 00:47:25 -0500
committerMatt A. Tobin <email@mattatobin.com>2022-05-29 00:47:25 -0500
commitf11b40c3ab4a5a766b0b71ab1e9a6199b23bbfeb (patch)
tree7b10fdf57c04235448662d0256ef76fa48a1d076 /js/src/jit/BaselineIC.cpp
parent5310bcfbad6c8687d0bdbe5e49fb73858dcc1631 (diff)
downloadaura-central-f11b40c3ab4a5a766b0b71ab1e9a6199b23bbfeb.tar.gz
[JS:Engine] Remove the use of tagged shape pointers
Diffstat (limited to 'js/src/jit/BaselineIC.cpp')
-rw-r--r--js/src/jit/BaselineIC.cpp40
1 files changed, 29 insertions, 11 deletions
diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp
index f5dcd2a10..7dbe239a7 100644
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -1145,9 +1145,9 @@ TryAttachNativeOrUnboxedGetValueElemStub(JSContext* cx, HandleScript script, jsb
return true;
bool needsAtomize = checkAtomize<T>(keyVal);
- RootedShape shape(cx);
+ Rooted<PropertyResult> prop(cx);
RootedObject holder(cx);
- if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &shape))
+ if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &prop))
return false;
if (!holder || (holder != obj && !holder->isNative()))
return true;
@@ -1214,6 +1214,8 @@ TryAttachNativeOrUnboxedGetValueElemStub(JSContext* cx, HandleScript script, jsb
if (!holder->isNative())
return true;
+ RootedShape shape(cx, prop.shape());
+
if (IsCacheableGetPropReadSlot(obj, holder, shape)) {
bool isFixedSlot;
uint32_t offset;
@@ -1264,13 +1266,14 @@ TryAttachNativeGetAccessorElemStub(JSContext* cx, HandleScript script, jsbytecod
return true;
bool needsAtomize = checkAtomize<T>(keyVal);
- RootedShape shape(cx);
+ Rooted<PropertyResult> prop(cx);
RootedObject baseHolder(cx);
- if (!EffectlesslyLookupProperty(cx, obj, id, &baseHolder, &shape))
+ if (!EffectlesslyLookupProperty(cx, obj, id, &baseHolder, &prop))
return false;
if (!baseHolder || !baseHolder->isNative())
return true;
+ RootedShape shape(cx, prop.shape());
HandleNativeObject holder = baseHolder.as<NativeObject>();
bool getterIsScripted = false;
@@ -3348,11 +3351,17 @@ TryAttachNativeInStub(JSContext* cx, HandleScript outerScript, ICIn_Fallback* st
return true;
RootedPropertyName name(cx, JSID_TO_ATOM(id)->asPropertyName());
- RootedShape shape(cx);
+ Rooted<PropertyResult> prop(cx);
RootedObject holder(cx);
- if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &shape))
+ if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &prop))
return false;
+ if (prop.isNonNativeProperty()) {
+ MOZ_ASSERT(!IsCacheableProtoChain(obj, holder, false));
+ return true;
+ }
+
+ RootedShape shape(cx, prop.maybeShape());
if (IsCacheableGetPropReadSlot(obj, holder, shape)) {
ICStub::Kind kind = (obj == holder) ? ICStub::In_Native
: ICStub::In_NativePrototype;
@@ -4259,14 +4268,17 @@ TryAttachSetValuePropStub(JSContext* cx, HandleScript script, jsbytecode* pc, IC
{
MOZ_ASSERT(!*attached);
- RootedShape shape(cx);
+ Rooted<PropertyResult> prop(cx);
RootedObject holder(cx);
- if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &shape))
+ if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &prop))
return false;
if (obj != holder)
return true;
- if (!obj->isNative()) {
+ RootedShape shape(cx);
+ if (obj->isNative()) {
+ shape = prop.shape();
+ } else {
if (obj->is<UnboxedPlainObject>()) {
UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando();
if (expando) {
@@ -4365,11 +4377,17 @@ TryAttachSetAccessorPropStub(JSContext* cx, HandleScript script, jsbytecode* pc,
MOZ_ASSERT(!*attached);
MOZ_ASSERT(!*isTemporarilyUnoptimizable);
- RootedShape shape(cx);
+ Rooted<PropertyResult> prop(cx);
RootedObject holder(cx);
- if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &shape))
+ if (!EffectlesslyLookupProperty(cx, obj, id, &holder, &prop))
return false;
+ if (prop.isNonNativeProperty()) {
+ MOZ_ASSERT(!IsCacheableProtoChain(obj, holder));
+ return true;
+ }
+
+ RootedShape shape(cx, prop.maybeShape());
bool isScripted = false;
bool cacheableCall = IsCacheableSetPropCall(cx, obj, holder, shape,
&isScripted, isTemporarilyUnoptimizable);