Keep key register pinned longer when accessing elements of hoisted arguments objects, bug 683207. r=dvander
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 30 Aug 2011 19:23:55 -0700
changeset 76255 005bce677a00b9a8e51b5df3f7d1974b261a1f76
parent 76254 fcca99426576dc967392dc279333e7b3053e2c29
child 76256 c7e6f57e173220fddbd6a0542df2f2d03465edae
push id1588
push usermak77@bonardo.net
push dateWed, 31 Aug 2011 08:45:28 +0000
treeherdermozilla-inbound@c7e6f57e1732 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs683207
milestone9.0a1
first release with
nightly linux32
005bce677a00 / 9.0a1 / 20110831030834 / files
nightly linux64
005bce677a00 / 9.0a1 / 20110831030834 / files
nightly mac
005bce677a00 / 9.0a1 / 20110831030834 / files
nightly win32
005bce677a00 / 9.0a1 / 20110831030834 / files
nightly win64
005bce677a00 / 9.0a1 / 20110831030834 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Keep key register pinned longer when accessing elements of hoisted arguments objects, bug 683207. r=dvander
js/src/methodjit/FastOps.cpp
--- a/js/src/methodjit/FastOps.cpp
+++ b/js/src/methodjit/FastOps.cpp
@@ -1811,19 +1811,16 @@ mjit::Compiler::jsop_getelem_args()
                  ? Int32Key::FromConstant(id->getValue().toInt32())
                  : Int32Key::FromRegister(frame.tempRegForData(id));
     if (!key.isConstant())
         frame.pinReg(key.reg());
 
     RegisterID dataReg = frame.allocReg();
     RegisterID typeReg = frame.allocReg();
 
-    if (!key.isConstant())
-        frame.unpinReg(key.reg());
-
     // Guard on nactual.
     if (!hoistedLength) {
         Address nactualAddr(JSFrameReg, StackFrame::offsetOfArgs());
         MaybeJump rangeGuard;
         if (key.isConstant()) {
             JS_ASSERT(key.index() >= 0);
             rangeGuard = masm.branch32(Assembler::BelowOrEqual, nactualAddr, Imm32(key.index()));
         } else {
@@ -1835,16 +1832,19 @@ mjit::Compiler::jsop_getelem_args()
     RegisterID actualsReg;
     if (actualsFe) {
         actualsReg = frame.tempRegForData(actualsFe);
     } else {
         actualsReg = dataReg;
         masm.loadFrameActuals(outerScript->function(), actualsReg);
     }
 
+    if (!key.isConstant())
+        frame.unpinReg(key.reg());
+
     if (key.isConstant()) {
         Address arg(actualsReg, key.index() * sizeof(Value));
         masm.loadValueAsComponents(arg, typeReg, dataReg);
     } else {
         JS_ASSERT(key.reg() != dataReg);
         BaseIndex arg(actualsReg, key.reg(), masm.JSVAL_SCALE);
         masm.loadValueAsComponents(arg, typeReg, dataReg);
     }