Bug 1566116 - Remove CacheIR op guardIndexGreaterThanDenseCapacity and it's emitter. r=jandem
authorTuan <tuan.mate@outlook.com>
Thu, 26 Mar 2020 10:56:29 +0000
changeset 520492 77eab1e3c3ae8c821c2844233888855817ba1613
parent 520491 b9355b941f2f2f2df906c44a85dd32deeea6b762
child 520493 eb884c85668282ef64c5b9d165878e93728ec10f
push id37252
push usermalexandru@mozilla.com
push dateThu, 26 Mar 2020 15:34:27 +0000
treeherdermozilla-central@31360ced8ff8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1566116
milestone76.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 1566116 - Remove CacheIR op guardIndexGreaterThanDenseCapacity and it's emitter. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D68334
js/src/jit/CacheIR.h
js/src/jit/CacheIRCompiler.cpp
js/src/jit/CacheIRCompiler.h
--- a/js/src/jit/CacheIR.h
+++ b/js/src/jit/CacheIR.h
@@ -243,17 +243,16 @@ extern const uint32_t ArgLengths[];
   _(GuardNoDenseElements, Id)                                                  \
   _(GuardAndGetIndexFromString, Id, Id)                                        \
   _(GuardAndGetNumberFromString, Id, Id)                                       \
   _(GuardAndGetNumberFromBoolean, Id, Id)                                      \
   _(GuardAndGetIterator, Id, Id, Field, Field)                                 \
   _(GuardHasGetterSetter, Id, Field)                                           \
   _(GuardGroupHasUnanalyzedNewScript, Field)                                   \
   _(GuardIndexIsNonNegative, Id)                                               \
-  _(GuardIndexGreaterThanDenseCapacity, Id, Id)                                \
   _(GuardIndexGreaterThanArrayLength, Id, Id)                                  \
   _(GuardIndexIsValidUpdateOrAdd, Id, Id)                                      \
   _(GuardIndexGreaterThanDenseInitLength, Id, Id)                              \
   _(GuardTagNotEqual, Id, Id)                                                  \
   _(GuardXrayExpandoShapeAndDefaultProto, Id, Byte, Field)                     \
   _(GuardFunctionPrototype, Id, Id, Field)                                     \
   _(GuardNoAllocationMetadataBuilder, None)                                    \
   _(GuardObjectGroupNotPretenured, Field)                                      \
@@ -1156,22 +1155,16 @@ class MOZ_RAII CacheIRWriter : public JS
   }
 
   void guardIndexGreaterThanDenseInitLength(ObjOperandId obj,
                                             Int32OperandId index) {
     writeOpWithOperandId(CacheOp::GuardIndexGreaterThanDenseInitLength, obj);
     writeOperandId(index);
   }
 
-  void guardIndexGreaterThanDenseCapacity(ObjOperandId obj,
-                                          Int32OperandId index) {
-    writeOpWithOperandId(CacheOp::GuardIndexGreaterThanDenseCapacity, obj);
-    writeOperandId(index);
-  }
-
   void guardIndexGreaterThanArrayLength(ObjOperandId obj,
                                         Int32OperandId index) {
     writeOpWithOperandId(CacheOp::GuardIndexGreaterThanArrayLength, obj);
     writeOperandId(index);
   }
 
   void guardIndexIsValidUpdateOrAdd(ObjOperandId obj, Int32OperandId index) {
     writeOpWithOperandId(CacheOp::GuardIndexIsValidUpdateOrAdd, obj);
--- a/js/src/jit/CacheIRCompiler.cpp
+++ b/js/src/jit/CacheIRCompiler.cpp
@@ -3094,41 +3094,16 @@ bool CacheIRCompiler::emitGuardIndexGrea
   Address capacity(scratch, ObjectElements::offsetOfInitializedLength());
   masm.spectreBoundsCheck32(index, capacity, spectreScratch, &outOfBounds);
   masm.jump(failure->label());
   masm.bind(&outOfBounds);
 
   return true;
 }
 
-bool CacheIRCompiler::emitGuardIndexGreaterThanDenseCapacity() {
-  JitSpew(JitSpew_Codegen, "%s", __FUNCTION__);
-  Register obj = allocator.useRegister(masm, reader.objOperandId());
-  Register index = allocator.useRegister(masm, reader.int32OperandId());
-  AutoScratchRegister scratch(allocator, masm);
-  AutoSpectreBoundsScratchRegister spectreScratch(allocator, masm);
-
-  FailurePath* failure;
-  if (!addFailurePath(&failure)) {
-    return false;
-  }
-
-  // Load obj->elements.
-  masm.loadPtr(Address(obj, NativeObject::offsetOfElements()), scratch);
-
-  // Ensure index >= capacity.
-  Label outOfBounds;
-  Address capacity(scratch, ObjectElements::offsetOfCapacity());
-  masm.spectreBoundsCheck32(index, capacity, spectreScratch, &outOfBounds);
-  masm.jump(failure->label());
-  masm.bind(&outOfBounds);
-
-  return true;
-}
-
 bool CacheIRCompiler::emitGuardIndexGreaterThanArrayLength() {
   JitSpew(JitSpew_Codegen, "%s", __FUNCTION__);
   Register obj = allocator.useRegister(masm, reader.objOperandId());
   Register index = allocator.useRegister(masm, reader.int32OperandId());
   AutoScratchRegister scratch(allocator, masm);
   AutoSpectreBoundsScratchRegister spectreScratch(allocator, masm);
 
   FailurePath* failure;
--- a/js/src/jit/CacheIRCompiler.h
+++ b/js/src/jit/CacheIRCompiler.h
@@ -51,17 +51,16 @@ class IonCacheIRCompiler;
   _(GuardNotDOMProxy)                     \
   _(GuardSpecificInt32Immediate)          \
   _(GuardMagicValue)                      \
   _(GuardNoDenseElements)                 \
   _(GuardAndGetNumberFromString)          \
   _(GuardAndGetNumberFromBoolean)         \
   _(GuardAndGetIndexFromString)           \
   _(GuardIndexIsNonNegative)              \
-  _(GuardIndexGreaterThanDenseCapacity)   \
   _(GuardIndexGreaterThanArrayLength)     \
   _(GuardIndexIsValidUpdateOrAdd)         \
   _(GuardIndexGreaterThanDenseInitLength) \
   _(GuardTagNotEqual)                     \
   _(GuardXrayExpandoShapeAndDefaultProto) \
   _(GuardNoAllocationMetadataBuilder)     \
   _(GuardObjectGroupNotPretenured)        \
   _(GuardFunctionHasJitEntry)             \