Bug 1642593 - Transpile GuardAnyClass. r=jandem
authorTom Schuster <evilpies@gmail.com>
Wed, 03 Jun 2020 17:23:46 +0000
changeset 597823 ce2ec4204fe8517bf7725d162ba55b6d3297966c
parent 597822 aa20bf181fd0f0dcb9d7f31acadabd69517ff7b3
child 597824 302d7d051a6b68b93e3b317d4244cf103dc0237d
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1642593
milestone79.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 1642593 - Transpile GuardAnyClass. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D77793
js/src/jit/CacheIROps.yaml
js/src/jit/WarpCacheIRTranspiler.cpp
--- a/js/src/jit/CacheIROps.yaml
+++ b/js/src/jit/CacheIROps.yaml
@@ -186,17 +186,17 @@
   transpile: true
   args:
     obj: ObjId
     kind: GuardClassKindImm
 
 # Guard on an arbitrary JSClass.
 - name: GuardAnyClass
   shared: false
-  transpile: false
+  transpile: true
   args:
     obj: ObjId
     clasp: RawPointerField
 
 # Add a reference to a global in the compartment to keep it alive.
 - name: GuardCompartment
   shared: false
   transpile: false
--- a/js/src/jit/WarpCacheIRTranspiler.cpp
+++ b/js/src/jit/WarpCacheIRTranspiler.cpp
@@ -79,16 +79,19 @@ class MOZ_RAII WarpCacheIRTranspiler : p
 
   uintptr_t readStubWord(uint32_t offset) {
     return stubInfo_->getStubRawWord(stubData_, offset);
   }
 
   Shape* shapeStubField(uint32_t offset) {
     return reinterpret_cast<Shape*>(readStubWord(offset));
   }
+  const JSClass* classStubField(uint32_t offset) {
+    return reinterpret_cast<const JSClass*>(readStubWord(offset));
+  }
   JSString* stringStubField(uint32_t offset) {
     return reinterpret_cast<JSString*>(readStubWord(offset));
   }
   JSObject* objectStubField(uint32_t offset) {
     return reinterpret_cast<JSObject*>(readStubWord(offset));
   }
   int32_t int32StubField(uint32_t offset) {
     return static_cast<int32_t>(readStubWord(offset));
@@ -182,16 +185,28 @@ bool WarpCacheIRTranspiler::emitGuardCla
 
   auto* ins = MGuardToClass::New(alloc(), def, classp);
   add(ins);
 
   setOperand(objId, ins);
   return true;
 }
 
+bool WarpCacheIRTranspiler::emitGuardAnyClass(ObjOperandId objId,
+                                              uint32_t claspOffset) {
+  MDefinition* def = getOperand(objId);
+  const JSClass* classp = classStubField(claspOffset);
+
+  auto* ins = MGuardToClass::New(alloc(), def, classp);
+  add(ins);
+
+  setOperand(objId, ins);
+  return true;
+}
+
 bool WarpCacheIRTranspiler::emitGuardShape(ObjOperandId objId,
                                            uint32_t shapeOffset) {
   MDefinition* def = getOperand(objId);
   Shape* shape = shapeStubField(shapeOffset);
 
   auto* ins = MGuardShape::New(alloc(), def, shape);
   add(ins);