Bug 853710. Optimise use of general purpose regs stm/ldm. r=mjrosenb
authorNicholas Cameron <ncameron@mozilla.com>
Thu, 28 Mar 2013 21:33:26 +1300
changeset 126543 9c98428a284e5ed5899bc8b9f11d033ae512af24
parent 126542 76ba219af069428248354dffbdcc18bbb54ec474
child 126544 1370c07c5d3d925ab114e0258d8714aa259c766e
push id24488
push userryanvm@gmail.com
push dateFri, 29 Mar 2013 00:54:52 +0000
treeherdermozilla-central@8aeabe064932 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjrosenb
bugs853710
milestone22.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 853710. Optimise use of general purpose regs stm/ldm. r=mjrosenb
js/src/ion/IonMacroAssembler.cpp
--- a/js/src/ion/IonMacroAssembler.cpp
+++ b/js/src/ion/IonMacroAssembler.cpp
@@ -126,28 +126,29 @@ template void MacroAssembler::guardType(
                                         Register scratch, Label *matched, Label *miss);
 
 void
 MacroAssembler::PushRegsInMask(RegisterSet set)
 {
     int32_t diffF = set.fpus().size() * sizeof(double);
     int32_t diffG = set.gprs().size() * STACK_SLOT_SIZE;
 
-    reserveStack(diffG);
 #ifdef JS_CPU_ARM
     if (set.gprs().size() > 1) {
-        startDataTransferM(IsStore, StackPointer, IA, NoWriteBack);
+        adjustFrame(diffG);
+        startDataTransferM(IsStore, StackPointer, DB, WriteBack);
         for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
             diffG -= STACK_SLOT_SIZE;
             transferReg(*iter);
         }
         finishDataTransfer();
     } else
 #endif
     {
+        reserveStack(diffG);
         for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
             diffG -= STACK_SLOT_SIZE;
             storePtr(*iter, Address(StackPointer, diffG));
         }
     }
     JS_ASSERT(diffG == 0);
 
 #ifdef JS_CPU_ARM
@@ -186,32 +187,33 @@ MacroAssembler::PopRegsInMaskIgnore(Regi
                 loadDouble(Address(StackPointer, diffF), *iter);
         }
         freeStack(reservedF);
     }
     JS_ASSERT(diffF == 0);
 
 #ifdef JS_CPU_ARM
     if (set.gprs().size() > 1 && ignore.empty(false)) {
-        startDataTransferM(IsLoad, StackPointer, IA, NoWriteBack);
+        startDataTransferM(IsLoad, StackPointer, IA, WriteBack);
         for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
             diffG -= STACK_SLOT_SIZE;
             transferReg(*iter);
         }
         finishDataTransfer();
+        adjustFrame(-reservedG);
     } else
 #endif
     {
         for (GeneralRegisterIterator iter(set.gprs()); iter.more(); iter++) {
             diffG -= STACK_SLOT_SIZE;
             if (!ignore.has(*iter))
                 loadPtr(Address(StackPointer, diffG), *iter);
         }
+        freeStack(reservedG);
     }
-    freeStack(reservedG);
     JS_ASSERT(diffG == 0);
 }
 
 template<typename T>
 void
 MacroAssembler::loadFromTypedArray(int arrayType, const T &src, AnyRegister dest, Register temp,
                                    Label *fail)
 {