Bug 1172470 - Remove unused unboxed case from GenerateDenseElementHole. r=jandem
authorTooru Fujisawa <arai_a@mac.com>
Fri, 12 Jun 2015 18:38:08 +0900
changeset 266678 ba30453354484e7518102ae4b97e58eacec71ed0
parent 266677 bd9902d39e751c53210999c6243e4d2780cb1d59
child 266679 b93ec2ad9a08d86f5a2dc773e0d10b0a4191b165
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1172470
milestone41.0a1
Bug 1172470 - Remove unused unboxed case from GenerateDenseElementHole. r=jandem
js/src/jit/IonCaches.cpp
--- a/js/src/jit/IonCaches.cpp
+++ b/js/src/jit/IonCaches.cpp
@@ -3614,40 +3614,32 @@ GenerateDenseElementHole(JSContext* cx, 
         Label hole;
         Address initLength(scratchReg, ObjectElements::offsetOfInitializedLength());
         masm.branch32(Assembler::NotEqual, initLength, Imm32(0), &failures);
 
         pobj = pobj->getProto();
     }
 
     // Ensure the index is an int32 value.
-    Register indexReg = InvalidReg;
-    Register elementsReg = InvalidReg;
-
-    if (index.reg().hasValue()) {
-        indexReg = scratchReg;
-        MOZ_ASSERT(indexReg != InvalidReg);
-        ValueOperand val = index.reg().valueReg();
-
-        masm.branchTestInt32(Assembler::NotEqual, val, &failures);
-
-        // Unbox the index.
-        masm.unboxInt32(val, indexReg);
-
-        // Make sure index is nonnegative.
-        masm.branch32(Assembler::LessThan, indexReg, Imm32(0), &failures);
-
-        // Save the object register.
-        masm.push(object);
-        elementsReg = object;
-    } else {
-        MOZ_ASSERT(!index.reg().typedReg().isFloat());
-        indexReg = index.reg().typedReg().gpr();
-        elementsReg = scratchReg;
-    }
+    Register indexReg = scratchReg;
+
+    MOZ_ASSERT(index.reg().hasValue());
+    ValueOperand val = index.reg().valueReg();
+
+    masm.branchTestInt32(Assembler::NotEqual, val, &failures);
+
+    // Unbox the index.
+    masm.unboxInt32(val, indexReg);
+
+    // Make sure index is nonnegative.
+    masm.branch32(Assembler::LessThan, indexReg, Imm32(0), &failures);
+
+    // Save the object register.
+    Register elementsReg = object;
+    masm.push(object);
 
     // Load elements vector.
     masm.loadPtr(Address(object, NativeObject::offsetOfElements()), elementsReg);
 
     // Guard on the initialized length.
     Label hole;
     Address initLength(elementsReg, ObjectElements::offsetOfInitializedLength());
     masm.branch32(Assembler::BelowOrEqual, initLength, indexReg, &hole);