Bug 1320670 part 1 - Use jsid instead of PropertyName in GetPropIRGenerator. r=h4writer
authorJan de Mooij <jdemooij@mozilla.com>
Mon, 05 Dec 2016 15:44:02 -1000
changeset 325265 6b75807ac2e04eb448ed0f6c1b27b526e17a0669
parent 325264 69526e44e3b9cd96a95ac85a44561de59787fdb6
child 325266 17f5bc695acc81a98f34c95eef31454c1706aa56
push id84640
push userjandemooij@gmail.com
push dateTue, 06 Dec 2016 01:52:01 +0000
treeherdermozilla-inbound@17f5bc695acc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersh4writer
bugs1320670
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1320670 part 1 - Use jsid instead of PropertyName in GetPropIRGenerator. r=h4writer
js/src/jit/BaselineIC.cpp
js/src/jit/CacheIR.cpp
js/src/jit/CacheIR.h
js/src/jit/SharedIC.cpp
js/src/jit/SharedIC.h
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -3359,17 +3359,17 @@ TryAttachNativeInDoesNotExistStub(JSCont
     RootedId id(cx);
     if (!IsOptimizableElementPropertyName(cx, key, &id))
         return true;
 
     // Check if does-not-exist can be confirmed on property.
     RootedPropertyName name(cx, JSID_TO_ATOM(id)->asPropertyName());
     RootedObject lastProto(cx);
     size_t protoChainDepth = SIZE_MAX;
-    if (!CheckHasNoSuchProperty(cx, obj.get(), name.get(), lastProto.address(), &protoChainDepth))
+    if (!CheckHasNoSuchProperty(cx, obj.get(), id, lastProto.address(), &protoChainDepth))
         return true;
     MOZ_ASSERT(protoChainDepth < SIZE_MAX);
 
     if (protoChainDepth > ICIn_NativeDoesNotExist::MAX_PROTO_CHAIN_DEPTH)
         return true;
 
     // Confirmed no-such-property. Add stub.
     JitSpew(JitSpew_BaselineIC, "  Generating In_NativeDoesNotExist stub");
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -15,23 +15,23 @@
 
 using namespace js;
 using namespace js::jit;
 
 using mozilla::Maybe;
 
 GetPropIRGenerator::GetPropIRGenerator(JSContext* cx, jsbytecode* pc, ICStubEngine engine,
                                        bool* isTemporarilyUnoptimizable,
-                                       HandleValue val, HandlePropertyName name,
+                                       HandleValue val, HandleValue idVal,
                                        MutableHandleValue res)
   : writer(cx),
     cx_(cx),
     pc_(pc),
     val_(val),
-    name_(name),
+    idVal_(idVal),
     res_(res),
     engine_(engine),
     isTemporarilyUnoptimizable_(isTemporarilyUnoptimizable),
     preliminaryObjectAction_(PreliminaryObjectAction::None)
 {}
 
 static void
 EmitLoadSlotResult(CacheIRWriter& writer, ObjOperandId holderOp, NativeObject* holder,
@@ -47,44 +47,46 @@ EmitLoadSlotResult(CacheIRWriter& writer
 
 bool
 GetPropIRGenerator::tryAttachStub()
 {
     AutoAssertNoPendingException aanpe(cx_);
 
     ValOperandId valId(writer.setInputOperandId(0));
 
+    RootedId id(cx_, INTERNED_STRING_TO_JSID(cx_, idVal_.toString())); //XXX
+
     if (val_.isObject()) {
         RootedObject obj(cx_, &val_.toObject());
         ObjOperandId objId = writer.guardIsObject(valId);
 
-        if (tryAttachObjectLength(obj, objId))
+        if (tryAttachObjectLength(obj, objId, id))
             return true;
-        if (tryAttachNative(obj, objId))
+        if (tryAttachNative(obj, objId, id))
             return true;
-        if (tryAttachUnboxed(obj, objId))
+        if (tryAttachUnboxed(obj, objId, id))
             return true;
-        if (tryAttachUnboxedExpando(obj, objId))
+        if (tryAttachUnboxedExpando(obj, objId, id))
             return true;
-        if (tryAttachTypedObject(obj, objId))
+        if (tryAttachTypedObject(obj, objId, id))
             return true;
-        if (tryAttachModuleNamespace(obj, objId))
+        if (tryAttachModuleNamespace(obj, objId, id))
             return true;
-        if (tryAttachWindowProxy(obj, objId))
+        if (tryAttachWindowProxy(obj, objId, id))
             return true;
-        if (tryAttachProxy(obj, objId))
+        if (tryAttachProxy(obj, objId, id))
             return true;
         return false;
     }
 
-    if (tryAttachPrimitive(valId))
+    if (tryAttachPrimitive(valId, id))
         return true;
-    if (tryAttachStringLength(valId))
+    if (tryAttachStringLength(valId, id))
         return true;
-    if (tryAttachMagicArguments(valId))
+    if (tryAttachMagicArguments(valId, id))
         return true;
 
     return false;
 }
 
 static bool
 IsCacheableNoProperty(JSContext* cx, JSObject* obj, JSObject* holder, Shape* shape, jsid id,
                       jsbytecode* pc)
@@ -93,17 +95,17 @@ IsCacheableNoProperty(JSContext* cx, JSO
         return false;
 
     MOZ_ASSERT(!holder);
 
     // If we're doing a name lookup, we have to throw a ReferenceError.
     if (*pc == JSOP_GETXPROP)
         return false;
 
-    return CheckHasNoSuchProperty(cx, obj, JSID_TO_ATOM(id)->asPropertyName());
+    return CheckHasNoSuchProperty(cx, obj, id);
 }
 
 enum NativeGetPropCacheability {
     CanAttachNone,
     CanAttachReadSlot,
     CanAttachCallGetter,
 };
 
@@ -296,30 +298,29 @@ EmitCallGetterResult(CacheIRWriter& writ
         ObjOperandId holderId = writer.loadObject(holder);
         writer.guardShape(holderId, holder->as<NativeObject>().lastProperty());
     }
 
     EmitCallGetterResultNoGuards(writer, obj, holder, shape, objId);
 }
 
 bool
-GetPropIRGenerator::tryAttachNative(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachNative(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     RootedShape shape(cx_);
     RootedNativeObject holder(cx_);
 
-    RootedId id(cx_, NameToId(name_));
     NativeGetPropCacheability type = CanAttachNativeGetProp(cx_, obj, id, &holder, &shape, pc_,
                                                             engine_, isTemporarilyUnoptimizable_);
     switch (type) {
       case CanAttachNone:
         return false;
       case CanAttachReadSlot:
         if (holder) {
-            EnsureTrackPropertyTypes(cx_, holder, NameToId(name_));
+            EnsureTrackPropertyTypes(cx_, holder, id);
             if (obj == holder) {
                 // See the comment in StripPreliminaryObjectStubs.
                 if (IsPreliminaryObject(obj))
                     preliminaryObjectAction_ = PreliminaryObjectAction::NotePreliminary;
                 else
                     preliminaryObjectAction_ = PreliminaryObjectAction::Unlink;
             }
         }
@@ -330,17 +331,17 @@ GetPropIRGenerator::tryAttachNative(Hand
         EmitCallGetterResult(writer, obj, holder, shape, objId);
         return true;
     }
 
     MOZ_CRASH("Bad NativeGetPropCacheability");
 }
 
 bool
-GetPropIRGenerator::tryAttachWindowProxy(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachWindowProxy(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     // Attach a stub when the receiver is a WindowProxy and we are calling some
     // kinds of JSNative getters on the Window object (the global object).
 
     if (!IsWindowProxy(obj))
         return false;
 
     // This must be a WindowProxy for the current Window/global. Else it would
@@ -349,17 +350,16 @@ GetPropIRGenerator::tryAttachWindowProxy
     MOZ_ASSERT(obj->getClass() == cx_->maybeWindowProxyClass());
     MOZ_ASSERT(ToWindowIfWindowProxy(obj) == cx_->global());
 
     // Now try to do the lookup on the Window (the current global) and see if
     // it's a native getter.
     HandleObject windowObj = cx_->global();
     RootedShape shape(cx_);
     RootedNativeObject holder(cx_);
-    RootedId id(cx_, NameToId(name_));
     NativeGetPropCacheability type = CanAttachNativeGetProp(cx_, windowObj, id, &holder, &shape, pc_,
                                                             engine_, isTemporarilyUnoptimizable_);
     if (type != CanAttachCallGetter ||
         !IsCacheableGetPropCallNative(windowObj, holder, shape))
     {
         return false;
     }
 
@@ -374,42 +374,42 @@ GetPropIRGenerator::tryAttachWindowProxy
     // on the Window object.
     writer.guardClass(objId, GuardClassKind::WindowProxy);
     ObjOperandId windowObjId = writer.loadObject(windowObj);
     EmitCallGetterResult(writer, windowObj, holder, shape, windowObjId);
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachGenericProxy(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachGenericProxy(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     MOZ_ASSERT(obj->is<ProxyObject>());
 
     writer.guardIsProxy(objId);
 
     // Ensure that the incoming object is not a DOM proxy, so that we can get to
     // the specialized stubs
     writer.guardNotDOMProxy(objId);
 
-    writer.callProxyGetResult(objId, NameToId(name_));
+    writer.callProxyGetResult(objId, id);
     writer.typeMonitorResult();
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachDOMProxyShadowed(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachDOMProxyShadowed(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     MOZ_ASSERT(IsCacheableDOMProxy(obj));
 
     writer.guardShape(objId, obj->maybeShape());
 
     // No need for more guards: we know this is a DOM proxy, since the shape
     // guard enforces a given JSClass, so just go ahead and emit the call to
     // ProxyGet.
-    writer.callProxyGetResult(objId, NameToId(name_));
+    writer.callProxyGetResult(objId, id);
     writer.typeMonitorResult();
     return true;
 }
 
 // Callers are expected to have already guarded on the shape of the
 // object, which guarantees the object is a DOM proxy.
 static void
 CheckDOMProxyExpandoDoesNotShadow(CacheIRWriter& writer, JSObject* obj, jsid id,
@@ -439,25 +439,24 @@ CheckDOMProxyExpandoDoesNotShadow(CacheI
         MOZ_ASSERT(!expandoObj.containsPure(id));
         writer.guardDOMExpandoObject(expandoId, expandoObj.lastProperty());
     } else {
         MOZ_CRASH("Invalid expando value");
     }
 }
 
 bool
-GetPropIRGenerator::tryAttachDOMProxyUnshadowed(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachDOMProxyUnshadowed(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     MOZ_ASSERT(IsCacheableDOMProxy(obj));
 
     RootedObject checkObj(cx_, obj->staticPrototype());
     RootedNativeObject holder(cx_);
     RootedShape shape(cx_);
 
-    RootedId id(cx_, NameToId(name_));
     NativeGetPropCacheability canCache = CanAttachNativeGetProp(cx_, checkObj, id, &holder, &shape,
                                                                 pc_, engine_,
                                                                 isTemporarilyUnoptimizable_);
     if (canCache == CanAttachNone)
         return false;
 
     writer.guardShape(objId, obj->maybeShape());
 
@@ -490,46 +489,45 @@ GetPropIRGenerator::tryAttachDOMProxyUns
         writer.callProxyGetResult(objId, id);
         writer.typeMonitorResult();
     }
 
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachProxy(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachProxy(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     if (!obj->is<ProxyObject>())
         return false;
 
     // Skim off DOM proxies.
     if (IsCacheableDOMProxy(obj)) {
-        RootedId id(cx_, NameToId(name_));
         DOMProxyShadowsResult shadows = GetDOMProxyShadowsCheck()(cx_, obj, id);
         if (shadows == ShadowCheckFailed) {
             cx_->clearPendingException();
             return false;
         }
         if (DOMProxyIsShadowing(shadows))
-            return tryAttachDOMProxyShadowed(obj, objId);
+            return tryAttachDOMProxyShadowed(obj, objId, id);
 
         MOZ_ASSERT(shadows == DoesntShadow || shadows == DoesntShadowUnique);
-        return tryAttachDOMProxyUnshadowed(obj, objId);
+        return tryAttachDOMProxyUnshadowed(obj, objId, id);
     }
 
-    return tryAttachGenericProxy(obj, objId);
+    return tryAttachGenericProxy(obj, objId, id);
 }
 
 bool
-GetPropIRGenerator::tryAttachUnboxed(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachUnboxed(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     if (!obj->is<UnboxedPlainObject>())
         return false;
 
-    const UnboxedLayout::Property* property = obj->as<UnboxedPlainObject>().layout().lookup(name_);
+    const UnboxedLayout::Property* property = obj->as<UnboxedPlainObject>().layout().lookup(id);
     if (!property)
         return false;
 
     if (!cx_->runtime()->jitSupportsFloatingPoint)
         return false;
 
     writer.guardGroup(objId, obj->group());
     writer.loadUnboxedPropertyResult(objId, property->type,
@@ -539,51 +537,51 @@ GetPropIRGenerator::tryAttachUnboxed(Han
     else
         writer.returnFromIC();
 
     preliminaryObjectAction_ = PreliminaryObjectAction::Unlink;
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachUnboxedExpando(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachUnboxedExpando(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     if (!obj->is<UnboxedPlainObject>())
         return false;
 
     UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando();
     if (!expando)
         return false;
 
-    Shape* shape = expando->lookup(cx_, NameToId(name_));
+    Shape* shape = expando->lookup(cx_, id);
     if (!shape || !shape->hasDefaultGetter() || !shape->hasSlot())
         return false;
 
     EmitReadSlotResult(writer, obj, obj, shape, objId);
     EmitReadSlotReturn(writer, obj, obj, shape);
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachTypedObject(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachTypedObject(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     if (!obj->is<TypedObject>() ||
         !cx_->runtime()->jitSupportsFloatingPoint ||
         cx_->compartment()->detachedTypedObjects)
     {
         return false;
     }
 
     TypedObject* typedObj = &obj->as<TypedObject>();
     if (!typedObj->typeDescr().is<StructTypeDescr>())
         return false;
 
     StructTypeDescr* structDescr = &typedObj->typeDescr().as<StructTypeDescr>();
     size_t fieldIndex;
-    if (!structDescr->fieldIndex(NameToId(name_), &fieldIndex))
+    if (!structDescr->fieldIndex(id, &fieldIndex))
         return false;
 
     TypeDescr* fieldDescr = &structDescr->fieldDescr(fieldIndex);
     if (!fieldDescr->is<SimpleTypeDescr>())
         return false;
 
     Shape* shape = typedObj->maybeShape();
     TypedThingLayout layout = GetTypedThingLayout(shape->getObjectClass());
@@ -609,19 +607,19 @@ GetPropIRGenerator::tryAttachTypedObject
         writer.typeMonitorResult();
     else
         writer.returnFromIC();
 
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachObjectLength(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachObjectLength(HandleObject obj, ObjOperandId objId, HandleId id)
 {
-    if (name_ != cx_->names().length)
+    if (!JSID_IS_ATOM(id, cx_->names().length))
         return false;
 
     if (obj->is<ArrayObject>()) {
         // Make sure int32 is added to the TypeSet before we attach a stub, so
         // the stub can return int32 values without monitoring the result.
         if (obj->as<ArrayObject>().length() > INT32_MAX)
             return false;
 
@@ -649,25 +647,25 @@ GetPropIRGenerator::tryAttachObjectLengt
         writer.returnFromIC();
         return true;
     }
 
     return false;
 }
 
 bool
-GetPropIRGenerator::tryAttachModuleNamespace(HandleObject obj, ObjOperandId objId)
+GetPropIRGenerator::tryAttachModuleNamespace(HandleObject obj, ObjOperandId objId, HandleId id)
 {
     if (!obj->is<ModuleNamespaceObject>())
         return false;
 
     Rooted<ModuleNamespaceObject*> ns(cx_, &obj->as<ModuleNamespaceObject>());
     RootedModuleEnvironmentObject env(cx_);
     RootedShape shape(cx_);
-    if (!ns->bindings().lookup(NameToId(name_), env.address(), shape.address()))
+    if (!ns->bindings().lookup(id, env.address(), shape.address()))
         return false;
 
     // Don't emit a stub until the target binding has been initialized.
     if (env->getSlot(shape->slot()).isMagic(JS_UNINITIALIZED_LEXICAL))
         return false;
 
     if (IsIonEnabled(cx_))
         EnsureTrackPropertyTypes(cx_, env, shape->propid());
@@ -677,22 +675,22 @@ GetPropIRGenerator::tryAttachModuleNames
 
     ObjOperandId envId = writer.loadObject(env);
     EmitLoadSlotResult(writer, envId, env, shape);
     writer.typeMonitorResult();
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachPrimitive(ValOperandId valId)
+GetPropIRGenerator::tryAttachPrimitive(ValOperandId valId, HandleId id)
 {
     JSValueType primitiveType;
     RootedNativeObject proto(cx_);
     if (val_.isString()) {
-        if (name_ == cx_->names().length) {
+        if (JSID_IS_ATOM(id, cx_->names().length)) {
             // String length is special-cased, see js::GetProperty.
             return false;
         }
         primitiveType = JSVAL_TYPE_STRING;
         proto = MaybeNativeObject(GetBuiltinPrototypePure(cx_->global(), JSProto_String));
     } else if (val_.isNumber()) {
         primitiveType = JSVAL_TYPE_DOUBLE;
         proto = MaybeNativeObject(GetBuiltinPrototypePure(cx_->global(), JSProto_Number));
@@ -705,17 +703,16 @@ GetPropIRGenerator::tryAttachPrimitive(V
     } else {
         MOZ_ASSERT(val_.isNullOrUndefined() || val_.isMagic());
         return false;
     }
     if (!proto)
         return false;
 
     // Instantiate this property, for use during Ion compilation.
-    RootedId id(cx_, NameToId(name_));
     if (IsIonEnabled(cx_))
         EnsureTrackPropertyTypes(cx_, proto, id);
 
     // For now, only look for properties directly set on the prototype.
     Shape* shape = proto->lookup(cx_, id);
     if (!shape || !shape->hasSlot() || !shape->hasDefaultGetter())
         return false;
 
@@ -724,42 +721,42 @@ GetPropIRGenerator::tryAttachPrimitive(V
     ObjOperandId protoId = writer.loadObject(proto);
     writer.guardShape(protoId, proto->lastProperty());
     EmitLoadSlotResult(writer, protoId, proto, shape);
     writer.typeMonitorResult();
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachStringLength(ValOperandId valId)
+GetPropIRGenerator::tryAttachStringLength(ValOperandId valId, HandleId id)
 {
-    if (!val_.isString() || name_ != cx_->names().length)
+    if (!val_.isString() || !JSID_IS_ATOM(id, cx_->names().length))
         return false;
 
     StringOperandId strId = writer.guardIsString(valId);
     writer.loadStringLengthResult(strId);
     writer.returnFromIC();
     return true;
 }
 
 bool
-GetPropIRGenerator::tryAttachMagicArguments(ValOperandId valId)
+GetPropIRGenerator::tryAttachMagicArguments(ValOperandId valId, HandleId id)
 {
     if (!val_.isMagic(JS_OPTIMIZED_ARGUMENTS))
         return false;
 
-    if (name_ != cx_->names().length && name_ != cx_->names().callee)
+    if (!JSID_IS_ATOM(id, cx_->names().length) && !JSID_IS_ATOM(id, cx_->names().callee))
         return false;
 
     writer.guardMagicValue(valId, JS_OPTIMIZED_ARGUMENTS);
     writer.guardFrameHasNoArgumentsObject();
 
-    if (name_ == cx_->names().length) {
+    if (JSID_IS_ATOM(id, cx_->names().length)) {
         writer.loadFrameNumActualArgsResult();
         writer.returnFromIC();
     } else {
-        MOZ_ASSERT(name_ == cx_->names().callee);
+        MOZ_ASSERT(JSID_IS_ATOM(id, cx_->names().callee));
         writer.loadFrameCalleeResult();
         writer.typeMonitorResult();
     }
 
     return true;
 }
--- a/js/src/jit/CacheIR.h
+++ b/js/src/jit/CacheIR.h
@@ -556,48 +556,48 @@ class MOZ_RAII CacheIRReader
 
 // GetPropIRGenerator generates CacheIR for a GetProp IC.
 class MOZ_RAII GetPropIRGenerator
 {
     CacheIRWriter writer;
     JSContext* cx_;
     jsbytecode* pc_;
     HandleValue val_;
-    HandlePropertyName name_;
+    HandleValue idVal_;
     MutableHandleValue res_;
     ICStubEngine engine_;
     bool* isTemporarilyUnoptimizable_;
 
     enum class PreliminaryObjectAction { None, Unlink, NotePreliminary };
     PreliminaryObjectAction preliminaryObjectAction_;
 
-    bool tryAttachNative(HandleObject obj, ObjOperandId objId);
-    bool tryAttachUnboxed(HandleObject obj, ObjOperandId objId);
-    bool tryAttachUnboxedExpando(HandleObject obj, ObjOperandId objId);
-    bool tryAttachTypedObject(HandleObject obj, ObjOperandId objId);
-    bool tryAttachObjectLength(HandleObject obj, ObjOperandId objId);
-    bool tryAttachModuleNamespace(HandleObject obj, ObjOperandId objId);
-    bool tryAttachWindowProxy(HandleObject obj, ObjOperandId objId);
+    bool tryAttachNative(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachUnboxed(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachUnboxedExpando(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachTypedObject(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachObjectLength(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachModuleNamespace(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachWindowProxy(HandleObject obj, ObjOperandId objId, HandleId id);
 
-    bool tryAttachGenericProxy(HandleObject obj, ObjOperandId objId);
-    bool tryAttachDOMProxyShadowed(HandleObject obj, ObjOperandId objId);
-    bool tryAttachDOMProxyUnshadowed(HandleObject obj, ObjOperandId objId);
-    bool tryAttachProxy(HandleObject obj, ObjOperandId objId);
+    bool tryAttachGenericProxy(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachDOMProxyShadowed(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachDOMProxyUnshadowed(HandleObject obj, ObjOperandId objId, HandleId id);
+    bool tryAttachProxy(HandleObject obj, ObjOperandId objId, HandleId id);
 
-    bool tryAttachPrimitive(ValOperandId valId);
-    bool tryAttachStringLength(ValOperandId valId);
-    bool tryAttachMagicArguments(ValOperandId valId);
+    bool tryAttachPrimitive(ValOperandId valId, HandleId id);
+    bool tryAttachStringLength(ValOperandId valId, HandleId id);
+    bool tryAttachMagicArguments(ValOperandId valId, HandleId id);
 
     GetPropIRGenerator(const GetPropIRGenerator&) = delete;
     GetPropIRGenerator& operator=(const GetPropIRGenerator&) = delete;
 
   public:
     GetPropIRGenerator(JSContext* cx, jsbytecode* pc, ICStubEngine engine,
                        bool* isTemporarilyUnoptimizable,
-                       HandleValue val, HandlePropertyName name, MutableHandleValue res);
+                       HandleValue val, HandleValue idVal, MutableHandleValue res);
 
     bool tryAttachStub();
 
     bool shouldUnlinkPreliminaryObjectStubs() const {
         return preliminaryObjectAction_ == PreliminaryObjectAction::Unlink;
     }
     bool shouldNotePreliminaryObjectStub() const {
         return preliminaryObjectAction_ == PreliminaryObjectAction::NotePreliminary;
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -2276,41 +2276,41 @@ UpdateExistingGetPropCallStubs(ICFallbac
             }
         }
     }
 
     return foundMatchingStub;
 }
 
 bool
-CheckHasNoSuchProperty(JSContext* cx, JSObject* obj, PropertyName* name,
+CheckHasNoSuchProperty(JSContext* cx, JSObject* obj, jsid id,
                        JSObject** lastProto, size_t* protoChainDepthOut)
 {
     size_t depth = 0;
     JSObject* curObj = obj;
     while (curObj) {
         if (curObj->isNative()) {
             // Don't handle proto chains with resolve hooks.
-            if (ClassMayResolveId(cx->names(), curObj->getClass(), NameToId(name), curObj))
+            if (ClassMayResolveId(cx->names(), curObj->getClass(), id, curObj))
                 return false;
-            if (curObj->as<NativeObject>().contains(cx, NameToId(name)))
+            if (curObj->as<NativeObject>().contains(cx, id))
                 return false;
             if (curObj->getClass()->getGetProperty())
                 return false;
         } else if (curObj != obj) {
             // Non-native objects are only handled as the original receiver.
             return false;
         } else if (curObj->is<UnboxedPlainObject>()) {
-            if (curObj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, NameToId(name)))
+            if (curObj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, id))
                 return false;
         } else if (curObj->is<UnboxedArrayObject>()) {
-            if (name == cx->names().length)
+            if (JSID_IS_ATOM(id, cx->names().length))
                 return false;
         } else if (curObj->is<TypedObject>()) {
-            if (curObj->as<TypedObject>().typeDescr().hasProperty(cx->names(), NameToId(name)))
+            if (curObj->as<TypedObject>().typeDescr().hasProperty(cx->names(), id))
                 return false;
         } else {
             return false;
         }
 
         JSObject* proto = curObj->staticPrototype();
         if (!proto)
             break;
@@ -2399,17 +2399,18 @@ DoGetPropFallback(JSContext* cx, void* p
         ICStub* newStub = compiler.getStub(compiler.getStubSpace(info.outerScript(cx)));
         if (!newStub)
             return false;
         stub->addNewStub(newStub);
         attached = true;
     }
 
     if (!attached && !JitOptions.disableCacheIR) {
-        GetPropIRGenerator gen(cx, pc, engine, &isTemporarilyUnoptimizable, val, name, res);
+        RootedValue idVal(cx, StringValue(name));
+        GetPropIRGenerator gen(cx, pc, engine, &isTemporarilyUnoptimizable, val, idVal, res);
         if (gen.tryAttachStub()) {
             ICStub* newStub = AttachBaselineCacheIRStub(cx, gen.writerRef(), CacheKind::GetProp,
                                                         engine, info.outerScript(cx), stub);
             if (newStub) {
                 JitSpew(JitSpew_BaselineIC, "  Attached CacheIR stub");
                 attached = true;
                 if (gen.shouldNotePreliminaryObjectStub())
                     newStub->toCacheIR_Monitored()->notePreliminaryObject();
--- a/js/src/jit/SharedIC.h
+++ b/js/src/jit/SharedIC.h
@@ -2233,17 +2233,17 @@ IsCacheableGetPropCall(JSContext* cx, JS
 
 MOZ_MUST_USE bool
 UpdateExistingGetPropCallStubs(ICFallbackStub* fallbackStub,
                                ICStub::Kind kind,
                                HandleNativeObject holder,
                                HandleObject receiver,
                                HandleFunction getter);
 MOZ_MUST_USE bool
-CheckHasNoSuchProperty(JSContext* cx, JSObject* obj, PropertyName* name,
+CheckHasNoSuchProperty(JSContext* cx, JSObject* obj, jsid id,
                        JSObject** lastProto = nullptr, size_t* protoChainDepthOut = nullptr);
 
 void
 GuardReceiverObject(MacroAssembler& masm, ReceiverGuard guard,
                     Register object, Register scratch,
                     size_t receiverGuardOffset, Label* failure);
 
 MOZ_MUST_USE bool