Bug 1360852 - Fix emitGuardIsInt32Index to allocate input register before calling addFailurePath. r=evilpie, a=abillings
authorJan de Mooij <jdemooij@mozilla.com>
Mon, 01 May 2017 12:38:51 -0400
changeset 396097 4c630b9a7d2f7bce143ea7ffcd9a42b44de59d2c
parent 396096 fe9c7ccfd5fb004a20153fe925fac3a2cd0e85f8
child 396098 dbdaa649ec554f92804becbab17743791cab3ad6
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpie, abillings
bugs1360852
milestone54.0
Bug 1360852 - Fix emitGuardIsInt32Index to allocate input register before calling addFailurePath. r=evilpie, a=abillings
js/src/jit/CacheIRCompiler.cpp
--- a/js/src/jit/CacheIRCompiler.cpp
+++ b/js/src/jit/CacheIRCompiler.cpp
@@ -1241,22 +1241,22 @@ CacheIRCompiler::emitGuardIsInt32Index()
     Register output = allocator.defineRegister(masm, reader.int32OperandId());
 
     if (allocator.knownType(inputId) == JSVAL_TYPE_INT32) {
         Register input = allocator.useRegister(masm, Int32OperandId(inputId.id()));
         masm.move32(input, output);
         return true;
     }
 
+    ValueOperand input = allocator.useValueRegister(masm, inputId);
+
     FailurePath* failure;
     if (!addFailurePath(&failure))
         return false;
 
-    ValueOperand input = allocator.useValueRegister(masm, inputId);
-
     Label notInt32, done;
     masm.branchTestInt32(Assembler::NotEqual, input, &notInt32);
     masm.unboxInt32(input, output);
     masm.jump(&done);
 
     masm.bind(&notInt32);
 
     if (cx_->runtime()->jitSupportsFloatingPoint) {