Bug 812280 - Remove move32/movePtr overloads that take an Address. r=dvander
authorJan de Mooij <jdemooij@mozilla.com>
Fri, 16 Nov 2012 12:05:55 +0100
changeset 113487 4d3a1e4228ac694cf919c4bb1ae9d71bd3ba5600
parent 113486 b72fbbbfc6713557b23c290d163ddc7b1d25bd0b
child 113488 d907ac7bf66917b1a8815bde505ede8bb416cd6b
push id23872
push useremorley@mozilla.com
push dateFri, 16 Nov 2012 17:06:27 +0000
treeherdermozilla-central@a7ed19f7d21a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander
bugs812280
milestone19.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 812280 - Remove move32/movePtr overloads that take an Address. r=dvander
js/src/ion/CodeGenerator.cpp
js/src/ion/IonMacroAssembler.cpp
js/src/ion/arm/MacroAssembler-arm.cpp
js/src/ion/arm/MacroAssembler-arm.h
js/src/ion/shared/MacroAssembler-x86-shared.h
js/src/ion/x64/MacroAssembler-x64.h
js/src/ion/x86/MacroAssembler-x86.h
--- a/js/src/ion/CodeGenerator.cpp
+++ b/js/src/ion/CodeGenerator.cpp
@@ -845,19 +845,19 @@ CodeGenerator::visitCallGeneric(LCallGen
     masm.cmpPtr(nargsreg, ImmWord(&js::FunctionClass));
     if (!bailoutIf(Assembler::NotEqual, call->snapshot()))
         return false;
 
     // Guard that calleereg is a non-native function:
     masm.branchIfFunctionIsNative(calleereg, &invoke);
 
     // Knowing that calleereg is a non-native function, load the JSScript.
-    masm.movePtr(Address(calleereg, offsetof(JSFunction, u.i.script_)), objreg);
+    masm.loadPtr(Address(calleereg, offsetof(JSFunction, u.i.script_)), objreg);
     ExecutionMode executionMode = gen->info().executionMode();
-    masm.movePtr(Address(objreg, ionOffset(executionMode)), objreg);
+    masm.loadPtr(Address(objreg, ionOffset(executionMode)), objreg);
 
     // Guard that the IonScript has been compiled.
     masm.branchPtr(Assembler::BelowOrEqual, objreg, ImmWord(ION_COMPILING_SCRIPT), &invoke);
 
     // Nestle the StackPointer up to the argument vector.
     masm.freeStack(unusedStack);
 
     // Construct the IonFramePrefix.
@@ -867,26 +867,26 @@ CodeGenerator::visitCallGeneric(LCallGen
     masm.Push(Imm32(descriptor));
 
     // Check whether the provided arguments satisfy target argc.
     masm.load16ZeroExtend(Address(calleereg, offsetof(JSFunction, nargs)), nargsreg);
     masm.cmp32(nargsreg, Imm32(call->numStackArgs()));
     masm.j(Assembler::Above, &thunk);
 
     // No argument fixup needed. Load the start of the target IonCode.
-    masm.movePtr(Address(objreg, IonScript::offsetOfMethod()), objreg);
-    masm.movePtr(Address(objreg, IonCode::offsetOfCode()), objreg);
+    masm.loadPtr(Address(objreg, IonScript::offsetOfMethod()), objreg);
+    masm.loadPtr(Address(objreg, IonCode::offsetOfCode()), objreg);
     masm.jump(&makeCall);
 
     // Argument fixed needed. Load the ArgumentsRectifier.
     masm.bind(&thunk);
     {
         JS_ASSERT(ArgumentsRectifierReg != objreg);
         masm.movePtr(ImmGCPtr(argumentsRectifier), objreg); // Necessary for GC marking.
-        masm.movePtr(Address(objreg, IonCode::offsetOfCode()), objreg);
+        masm.loadPtr(Address(objreg, IonCode::offsetOfCode()), objreg);
         masm.move32(Imm32(call->numStackArgs()), ArgumentsRectifierReg);
     }
 
     // Finally call the function in objreg.
     masm.bind(&makeCall);
     uint32 callOffset = masm.callIon(objreg);
     if (!markSafepointAt(callOffset, call))
         return false;
@@ -938,25 +938,25 @@ CodeGenerator::visitCallKnown(LCallKnown
             masm.bind(&notPrimitive);
         }
 
         dropArguments(call->numStackArgs() + 1);
         return true;
     }
 
     // Knowing that calleereg is a non-native function, load the JSScript.
-    masm.movePtr(Address(calleereg, offsetof(JSFunction, u.i.script_)), objreg);
-    masm.movePtr(Address(objreg, ionOffset(executionMode)), objreg);
+    masm.loadPtr(Address(calleereg, offsetof(JSFunction, u.i.script_)), objreg);
+    masm.loadPtr(Address(objreg, ionOffset(executionMode)), objreg);
 
     // Guard that the IonScript has been compiled.
     masm.branchPtr(Assembler::BelowOrEqual, objreg, ImmWord(ION_COMPILING_SCRIPT), &invoke);
 
     // Load the start of the target IonCode.
-    masm.movePtr(Address(objreg, IonScript::offsetOfMethod()), objreg);
-    masm.movePtr(Address(objreg, IonCode::offsetOfCode()), objreg);
+    masm.loadPtr(Address(objreg, IonScript::offsetOfMethod()), objreg);
+    masm.loadPtr(Address(objreg, IonCode::offsetOfCode()), objreg);
 
     // Nestle the StackPointer up to the argument vector.
     masm.freeStack(unusedStack);
 
     // Construct the IonFramePrefix.
     uint32 descriptor = MakeFrameDescriptor(masm.framePushed(), IonFrame_OptimizedJS);
     masm.Push(Imm32(call->numActualArgs()));
     masm.Push(calleereg);
@@ -1153,18 +1153,18 @@ CodeGenerator::visitApplyArgsGeneric(LAp
     if (!apply->hasSingleTarget()) {
         masm.branchIfFunctionIsNative(calleereg, &invoke);
     } else {
         // Native single targets are handled by LCallNative.
         JS_ASSERT(!apply->getSingleTarget()->isNative());
     }
 
     // Knowing that calleereg is a non-native function, load the JSScript.
-    masm.movePtr(Address(calleereg, offsetof(JSFunction, u.i.script_)), objreg);
-    masm.movePtr(Address(objreg, ionOffset(executionMode)), objreg);
+    masm.loadPtr(Address(calleereg, offsetof(JSFunction, u.i.script_)), objreg);
+    masm.loadPtr(Address(objreg, ionOffset(executionMode)), objreg);
 
     // Guard that the IonScript has been compiled.
     masm.branchPtr(Assembler::BelowOrEqual, objreg, ImmWord(ION_COMPILING_SCRIPT), &invoke);
 
     // Call with an Ion frame or a rectifier frame.
     {
         // Create the frame descriptor.
         unsigned pushed = masm.framePushed();
@@ -1184,47 +1184,47 @@ CodeGenerator::visitApplyArgsGeneric(LAp
             masm.j(Assembler::Below, &underflow);
         } else {
             masm.cmp32(argcreg, Imm32(apply->getSingleTarget()->nargs));
             masm.j(Assembler::Below, &underflow);
         }
 
         // No argument fixup needed. Load the start of the target IonCode.
         {
-            masm.movePtr(Address(objreg, IonScript::offsetOfMethod()), objreg);
-            masm.movePtr(Address(objreg, IonCode::offsetOfCode()), objreg);
+            masm.loadPtr(Address(objreg, IonScript::offsetOfMethod()), objreg);
+            masm.loadPtr(Address(objreg, IonCode::offsetOfCode()), objreg);
 
             // Skip the construction of the rectifier frame because we have no
             // underflow.
             masm.jump(&rejoin);
         }
 
         // Argument fixup needed. Get ready to call the argumentsRectifier.
         {
             masm.bind(&underflow);
 
             // Hardcode the address of the argumentsRectifier code.
             IonCompartment *ion = gen->ionCompartment();
             IonCode *argumentsRectifier = ion->getArgumentsRectifier();
 
             JS_ASSERT(ArgumentsRectifierReg != objreg);
             masm.movePtr(ImmGCPtr(argumentsRectifier), objreg); // Necessary for GC marking.
-            masm.movePtr(Address(objreg, IonCode::offsetOfCode()), objreg);
+            masm.loadPtr(Address(objreg, IonCode::offsetOfCode()), objreg);
             masm.movePtr(argcreg, ArgumentsRectifierReg);
         }
 
         masm.bind(&rejoin);
 
         // Finally call the function in objreg, as assigned by one of the paths above.
         uint32 callOffset = masm.callIon(objreg);
         if (!markSafepointAt(callOffset, apply))
             return false;
 
         // Recover the number of arguments from the frame descriptor.
-        masm.movePtr(Address(StackPointer, 0), copyreg);
+        masm.loadPtr(Address(StackPointer, 0), copyreg);
         masm.rshiftPtr(Imm32(FRAMESIZE_SHIFT), copyreg);
         masm.subPtr(Imm32(pushed), copyreg);
 
         // Increment to remove IonFramePrefix; decrement to fill FrameSizeClass.
         // The return address has already been removed from the Ion frame.
         int prefixGarbage = sizeof(IonJSFrameLayout) - sizeof(void *);
         masm.adjustStack(prefixGarbage);
         masm.jump(&end);
@@ -2952,17 +2952,17 @@ CodeGenerator::visitIteratorEnd(LIterato
 
 bool
 CodeGenerator::visitArgumentsLength(LArgumentsLength *lir)
 {
     // read number of actual arguments from the JS frame.
     Register argc = ToRegister(lir->output());
     Address ptr(StackPointer, frameSize() + IonJSFrameLayout::offsetOfNumActualArgs());
 
-    masm.movePtr(ptr, argc);
+    masm.loadPtr(ptr, argc);
     return true;
 }
 
 bool
 CodeGenerator::visitGetArgument(LGetArgument *lir)
 {
     ValueOperand result = GetValueOutput(lir);
     const LAllocation *index = lir->index();
--- a/js/src/ion/IonMacroAssembler.cpp
+++ b/js/src/ion/IonMacroAssembler.cpp
@@ -421,17 +421,17 @@ MacroAssembler::initGCThing(const Regist
 
 void
 MacroAssembler::maybeRemoveOsrFrame(Register scratch)
 {
     // Before we link an exit frame, check for an OSR frame, which is
     // indicative of working inside an existing bailout. In this case, remove
     // the OSR frame, so we don't explode the stack with repeated bailouts.
     Label osrRemoved;
-    movePtr(Address(StackPointer, IonCommonFrameLayout::offsetOfDescriptor()), scratch);
+    loadPtr(Address(StackPointer, IonCommonFrameLayout::offsetOfDescriptor()), scratch);
     and32(Imm32(FRAMETYPE_MASK), scratch);
     branch32(Assembler::NotEqual, scratch, Imm32(IonFrame_Osr), &osrRemoved);
     addPtr(Imm32(sizeof(IonOsrFrameLayout)), StackPointer);
     bind(&osrRemoved);
 }
 
 void
 MacroAssembler::performOsr()
--- a/js/src/ion/arm/MacroAssembler-arm.cpp
+++ b/js/src/ion/arm/MacroAssembler-arm.cpp
@@ -1477,41 +1477,31 @@ MacroAssemblerARMCompat::orPtr(Imm32 imm
 }
 
 void
 MacroAssemblerARMCompat::move32(const Imm32 &imm, const Register &dest)
 {
     ma_mov(imm, dest);
 }
 void
-MacroAssemblerARMCompat::move32(const Address &src, const Register &dest)
-{
-    movePtr(src, dest);
-}
-void
 MacroAssemblerARMCompat::movePtr(const Register &src, const Register &dest)
 {
     ma_mov(src, dest);
 }
 void
 MacroAssemblerARMCompat::movePtr(const ImmWord &imm, const Register &dest)
 {
     ma_mov(Imm32(imm.value), dest);
 }
 void
 MacroAssemblerARMCompat::movePtr(const ImmGCPtr &imm, const Register &dest)
 {
     ma_mov(imm, dest);
 }
 void
-MacroAssemblerARMCompat::movePtr(const Address &src, const Register &dest)
-{
-    loadPtr(src, dest);
-}
-void
 MacroAssemblerARMCompat::load8ZeroExtend(const Address &address, const Register &dest)
 {
     ma_dataTransferN(IsLoad, 8, false, address.base, Imm32(address.offset), dest);
 }
 
 void
 MacroAssemblerARMCompat::load8ZeroExtend(const BaseIndex &src, const Register &dest)
 {
--- a/js/src/ion/arm/MacroAssembler-arm.h
+++ b/js/src/ion/arm/MacroAssembler-arm.h
@@ -595,21 +595,21 @@ class MacroAssemblerARMCompat : public M
         ma_cmp(lhs, rhs);
         ma_b(label, cond);
     }
     void branch32(Condition cond, Register lhs, Imm32 imm, Label *label) {
         ma_cmp(lhs, imm);
         ma_b(label, cond);
     }
     void branch32(Condition cond, const Address &lhs, Register rhs, Label *label) {
-        move32(lhs, ScratchRegister);
+        load32(lhs, ScratchRegister);
         branch32(cond, ScratchRegister, rhs, label);
     }
     void branch32(Condition cond, const Address &lhs, Imm32 rhs, Label *label) {
-        move32(lhs, ScratchRegister);
+        load32(lhs, ScratchRegister);
         branch32(cond, ScratchRegister, rhs, label);
     }
     void branchPtr(Condition cond, const Address &lhs, Register rhs, Label *label) {
         branch32(cond, lhs, rhs, label);
     }
 
     void branchPrivatePtr(Condition cond, const Address &lhs, ImmWord ptr, Label *label) {
         branchPtr(cond, lhs, ptr, label);
@@ -907,21 +907,19 @@ class MacroAssemblerARMCompat : public M
     void and32(Imm32 imm, Register dest);
     void and32(Imm32 imm, const Address &dest);
     void or32(Imm32 imm, const Address &dest);
     void orPtr(Imm32 imm, Register dest);
     void addPtr(Register src, Register dest);
 
     void move32(const Imm32 &imm, const Register &dest);
 
-    void move32(const Address &src, const Register &dest);
     void movePtr(const Register &src, const Register &dest);
     void movePtr(const ImmWord &imm, const Register &dest);
     void movePtr(const ImmGCPtr &imm, const Register &dest);
-    void movePtr(const Address &src, const Register &dest);
 
     void load8SignExtend(const Address &address, const Register &dest);
     void load8SignExtend(const BaseIndex &src, const Register &dest);
 
     void load8ZeroExtend(const Address &address, const Register &dest);
     void load8ZeroExtend(const BaseIndex &src, const Register &dest);
 
     void load16SignExtend(const Address &address, const Register &dest);
--- a/js/src/ion/shared/MacroAssembler-x86-shared.h
+++ b/js/src/ion/shared/MacroAssembler-x86-shared.h
@@ -59,19 +59,16 @@ class MacroAssemblerX86Shared : public A
             j(Parity, label);
             return;
         }
 
         JS_ASSERT(!(cond & DoubleConditionBitSpecial));
         j(ConditionFromDoubleCondition(cond), label);
     }
 
-    void move32(const Address &address, const Register &dest) {
-        movl(Operand(address), dest);
-    }
     void move32(const Imm32 &imm, const Register &dest) {
         if (imm.value == 0)
             xorl(dest, dest);
         else
             movl(imm, dest);
     }
     void and32(const Imm32 &imm, const Register &dest) {
         andl(imm, dest);
--- a/js/src/ion/x64/MacroAssembler-x64.h
+++ b/js/src/ion/x64/MacroAssembler-x64.h
@@ -182,19 +182,16 @@ class MacroAssemblerX64 : public MacroAs
         jsval_layout jv = JSVAL_TO_IMPL(val);
         push(ImmWord(jv.asBits));
     }
     void pushValue(JSValueType type, Register reg) {
         boxValue(type, reg, ScratchReg);
         push(ScratchReg);
     }
 
-    void movePtr(Operand op, const Register &dest) {
-        movq(op, dest);
-    }
     void moveValue(const Value &val, const Register &dest) {
         jsval_layout jv = JSVAL_TO_IMPL(val);
         movq(ImmWord(jv.asPtr), dest);
         writeDataRelocation(val);
     }
     void moveValue(const Value &src, const ValueOperand &dest) {
         moveValue(src, dest.valueReg());
     }
@@ -454,19 +451,16 @@ class MacroAssemblerX64 : public MacroAs
         movq(src, dest);
     }
     void movePtr(ImmWord imm, Register dest) {
         movq(imm, dest);
     }
     void movePtr(ImmGCPtr imm, Register dest) {
         movq(imm, dest);
     }
-    void movePtr(const Address &address, const Register &dest) {
-        movq(Operand(address), dest);
-    }
     void loadPtr(const AbsoluteAddress &address, Register dest) {
         movq(ImmWord(address.addr), ScratchReg);
         movq(Operand(ScratchReg, 0x0), dest);
     }
     void loadPtr(const Address &address, Register dest) {
         movq(Operand(address), dest);
     }
     void loadPtr(const BaseIndex &src, Register dest) {
--- a/js/src/ion/x86/MacroAssembler-x86.h
+++ b/js/src/ion/x86/MacroAssembler-x86.h
@@ -190,22 +190,16 @@ class MacroAssemblerX86 : public MacroAs
     }
     void storeTypeTag(ImmTag tag, Operand dest) {
         movl(tag, ToType(dest));
     }
 
     void movePtr(const Register &src, const Register &dest) {
         movl(src, dest);
     }
-    void movePtr(Operand op, const Register &dest) {
-        movl(op, dest);
-    }
-    void movePtr(const Address &src, const Register &dest) {
-        movl(Operand(src), dest);
-    }
 
     // Returns the register containing the type tag.
     Register splitTagForTest(const ValueOperand &value) {
         return value.typeReg();
     }
 
     Condition testUndefined(Condition cond, const Register &tag) {
         JS_ASSERT(cond == Equal || cond == NotEqual);