Don't clobber callee-save register when testing pushed value after stub calls, bug 687856. r=dvander
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 20 Sep 2011 13:32:49 -0700
changeset 77218 397abdbd54a81de1f22efa4094eb599772d13c99
parent 77217 e0ea0a7ecbee994529bd5a4e4cd231791cb3fffe
child 77219 2ca75ce160b0bffda896de07b8f30d5bd1336fd2
push id21187
push usermak77@bonardo.net
push dateWed, 21 Sep 2011 08:36:41 +0000
treeherdermozilla-central@3178f1c42505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs687856
milestone9.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
Don't clobber callee-save register when testing pushed value after stub calls, bug 687856. r=dvander
js/src/methodjit/BaseAssembler.h
--- a/js/src/methodjit/BaseAssembler.h
+++ b/js/src/methodjit/BaseAssembler.h
@@ -1143,17 +1143,17 @@ static const JSC::MacroAssembler::Regist
     static uint32 maskAddress(BaseIndex address) {
         return Registers::maskReg(address.base) |
                Registers::maskReg(address.index);
     }
 
     /*
      * Generate code testing whether an in memory value at address has a type
      * in the specified set. Updates mismatches with any failure jumps. Assumes
-     * no data registers are live.
+     * that no temporary (caller save) registers are live.
      */
     bool generateTypeCheck(JSContext *cx, Address address,
                            types::TypeSet *types, Vector<Jump> *mismatches)
     {
         if (types->unknown())
             return true;
 
         Vector<Jump> matches(cx);
@@ -1193,18 +1193,17 @@ static const JSC::MacroAssembler::Regist
                 return false;
         } else {
             count = types->getObjectCount();
         }
 
         if (count != 0) {
             if (!mismatches->append(testObject(Assembler::NotEqual, address)))
                 return false;
-            Registers tempRegs(Registers::AvailRegs);
-            RegisterID reg = tempRegs.takeAnyReg().reg();
+            RegisterID reg = Registers::ArgReg1;
 
             loadPayload(address, reg);
 
             Jump notSingleton = branchTest32(Assembler::Zero,
                                              Address(reg, offsetof(JSObject, flags)),
                                              Imm32(JSObject::SINGLETON_TYPE));
 
             for (unsigned i = 0; i < count; i++) {