Back out 997672af6fc8:8a34b197be1d (bug 885169) for Win64 bustage
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 05 Sep 2013 20:24:20 -0700
changeset 145818 d35342e7bcd052ea82cad16316e9859f1963c562
parent 145753 df8f342e9a6bffffabbe54dc87a21f52fc7804d4
child 145819 db4c9548a30423d4c9aa92d079f1251227468234
child 155771 0363cdc8db21c8e18a3feae414a1312c0683b1f7
push id33402
push userMs2ger@gmail.com
push dateFri, 06 Sep 2013 10:32:21 +0000
treeherdermozilla-inbound@7884c58c28a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs885169
milestone26.0a1
backs out997672af6fc8750c7dcee69595ec1d40e82d50f1
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
Back out 997672af6fc8:8a34b197be1d (bug 885169) for Win64 bustage
js/src/jit/BaselineIC.cpp
js/src/jit/RegisterSets.h
js/src/jit/arm/MacroAssembler-arm.h
js/src/jit/arm/Trampoline-arm.cpp
js/src/jit/x86/MacroAssembler-x86.h
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -4461,17 +4461,17 @@ ICGetElem_Arguments::Compiler::generateS
 
     // Length check succeeded, now check the correct bit.  We clobber potential type regs
     // now.  Inputs will have to be reconstructed if we fail after this point, but that's
     // unlikely.
     Label failureReconstructInputs;
     regs = availableGeneralRegs(0);
     regs.takeUnchecked(objReg);
     regs.takeUnchecked(idxReg);
-    regs.take(scratchReg);
+    regs.takeUnchecked(scratchReg);
     Register argData = regs.takeAny();
     Register tempReg = regs.takeAny();
 
     // Load ArgumentsData
     masm.loadPrivate(Address(objReg, ArgumentsObject::getDataSlotOffset()), argData);
 
     // Load deletedBits bitArray pointer into scratchReg
     masm.loadPtr(Address(argData, offsetof(ArgumentsData, deletedBits)), scratchReg);
@@ -4483,17 +4483,16 @@ ICGetElem_Arguments::Compiler::generateS
 
     // Don't bother testing specific bit, if any bit is set in the word, fail.
     masm.branchPtr(Assembler::NotEqual, scratchReg, ImmWord((size_t)0), &failureReconstructInputs);
 
     // Load the value.  use scratchReg and tempReg to form a ValueOperand to load into.
     masm.addPtr(Imm32(ArgumentsData::offsetOfArgs()), argData);
     regs.add(scratchReg);
     regs.add(tempReg);
-    regs.add(argData);
     ValueOperand tempVal = regs.takeAnyValue();
     masm.loadValue(BaseIndex(argData, idxReg, ScaleFromElemWidth(sizeof(Value))), tempVal);
 
     // Makesure that this is not a FORWARD_TO_CALL_SLOT magic value.
     masm.branchTestMagic(Assembler::Equal, tempVal, &failureReconstructInputs);
 
     // Everything checked out, return value.
     masm.moveValue(tempVal, R0);
--- a/js/src/jit/RegisterSets.h
+++ b/js/src/jit/RegisterSets.h
@@ -395,22 +395,18 @@ class TypedRegisterSet
         takeUnchecked(value.typeReg());
 #elif defined(JS_PUNBOX64)
         takeUnchecked(value.valueReg());
 #else
 #error "Bad architecture"
 #endif
     }
     T getAny() const {
-        // The choice of first or last here is mostly arbitrary, as they are
-        // about the same speed on popular architectures. We choose first, as
-        // it has the advantage of using the "lower" registers more often. These
-        // registers are sometimes more efficient (e.g. optimized encodings for
-        // EAX on x86).
-        return getFirst();
+        JS_ASSERT(!empty());
+        return T::FromCode(mozilla::FloorLog2(bits_));
     }
     T getFirst() const {
         JS_ASSERT(!empty());
         return T::FromCode(mozilla::CountTrailingZeroes32(bits_));
     }
     T getLast() const {
         JS_ASSERT(!empty());
         int ireg = 31 - mozilla::CountLeadingZeroes32(bits_);
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -949,40 +949,22 @@ class MacroAssemblerARMCompat : public M
             loadInt32OrDouble(address.base, address.index, dest.fpu(), address.scale);
         else
             load32(address, dest.gpr());
     }
 
     void moveValue(const Value &val, const ValueOperand &dest);
 
     void moveValue(const ValueOperand &src, const ValueOperand &dest) {
-        Register s0 = src.typeReg(), d0 = dest.typeReg(),
-                 s1 = src.payloadReg(), d1 = dest.payloadReg();
-
-        // Either one or both of the source registers could be the same as a
-        // destination register.
-        if (s1 == d0) {
-            if (s0 == d1) {
-                // If both are, this is just a swap of two registers.
-                JS_ASSERT(d1 != ScratchRegister);
-                JS_ASSERT(d0 != ScratchRegister);
-                ma_mov(d1, ScratchRegister);
-                ma_mov(d0, d1);
-                ma_mov(ScratchRegister, d0);
-                return;
-            }
-            // If only one is, copy that source first.
-            mozilla::Swap(s0, s1);
-            mozilla::Swap(d0, d1);
-        }
-
-        if (s0 != d0)
-            ma_mov(s0, d0);
-        if (s1 != d1)
-            ma_mov(s1, d1);
+        JS_ASSERT(src.typeReg() != dest.payloadReg());
+        JS_ASSERT(src.payloadReg() != dest.typeReg());
+        if (src.typeReg() != dest.typeReg())
+            ma_mov(src.typeReg(), dest.typeReg());
+        if (src.payloadReg() != dest.payloadReg())
+            ma_mov(src.payloadReg(), dest.payloadReg());
     }
 
     void storeValue(ValueOperand val, Operand dst);
     void storeValue(ValueOperand val, const BaseIndex &dest);
     void storeValue(JSValueType type, Register reg, BaseIndex dest) {
         // Harder cases not handled yet.
         JS_ASSERT(dest.offset == 0);
         ma_alu(dest.base, lsl(dest.index, dest.scale), ScratchRegister, op_add);
--- a/js/src/jit/arm/Trampoline-arm.cpp
+++ b/js/src/jit/arm/Trampoline-arm.cpp
@@ -646,17 +646,16 @@ IonRuntime::generateVMWrapper(JSContext 
     MacroAssembler masm(cx);
     GeneralRegisterSet regs = GeneralRegisterSet(Register::Codes::WrapperMask);
 
     // Wrapper register set is a superset of Volatile register set.
     JS_STATIC_ASSERT((Register::Codes::VolatileMask & ~Register::Codes::WrapperMask) == 0);
 
     // The context is the first argument; r0 is the first argument register.
     Register cxreg = r0;
-    regs.take(cxreg);
 
     // Stack is:
     //    ... frame ...
     //  +8  [args] + argPadding
     //  +0  ExitFrame
     //
     // We're aligned to an exit frame, so link it up.
     masm.enterExitFrameAndLoadContext(&f, cxreg, regs.getAny(), f.executionMode);
--- a/js/src/jit/x86/MacroAssembler-x86.h
+++ b/js/src/jit/x86/MacroAssembler-x86.h
@@ -108,36 +108,22 @@ class MacroAssemblerX86 : public MacroAs
             movl(ImmGCPtr(reinterpret_cast<gc::Cell *>(val.toGCThing())), data);
         else
             movl(Imm32(jv.s.payload.i32), data);
     }
     void moveValue(const Value &val, const ValueOperand &dest) {
         moveValue(val, dest.typeReg(), dest.payloadReg());
     }
     void moveValue(const ValueOperand &src, const ValueOperand &dest) {
-        Register s0 = src.typeReg(), d0 = dest.typeReg(),
-                 s1 = src.payloadReg(), d1 = dest.payloadReg();
-
-        // Either one or both of the source registers could be the same as a
-        // destination register.
-        if (s1 == d0) {
-            if (s0 == d1) {
-                // If both are, this is just a swap of two registers.
-                xchgl(d0, d1);
-                return;
-            }
-            // If only one is, copy that source first.
-            mozilla::Swap(s0, s1);
-            mozilla::Swap(d0, d1);
-        }
-
-        if (s0 != d0)
-            movl(s0, d0);
-        if (s1 != d1)
-            movl(s1, d1);
+        JS_ASSERT(src.typeReg() != dest.payloadReg());
+        JS_ASSERT(src.payloadReg() != dest.typeReg());
+        if (src.typeReg() != dest.typeReg())
+            movl(src.typeReg(), dest.typeReg());
+        if (src.payloadReg() != dest.payloadReg())
+            movl(src.payloadReg(), dest.payloadReg());
     }
 
     /////////////////////////////////////////////////////////////////
     // X86/X64-common interface.
     /////////////////////////////////////////////////////////////////
     void storeValue(ValueOperand val, Operand dest) {
         movl(val.payloadReg(), ToPayload(dest));
         movl(val.typeReg(), ToType(dest));