When outputting a tracable value, make sure the value we put out can be written over later. (bug 732946, r=jandem)
authorMarty Rosenberg <mrosenberg@mozilla.com>
Tue, 06 Mar 2012 02:05:51 -0800
changeset 112236 bd6f0d8274571f8d08a88934a4157f438a8621ad
parent 112235 9f5a72b6b814f98dad5285d5e6a98b31cd5fe7d5
child 112237 d72074514c6fa4aec75323b18f135b0e720f3e7a
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-beta@27b14fe50103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs732946
milestone13.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
When outputting a tracable value, make sure the value we put out can be written over later. (bug 732946, r=jandem)
js/src/ion/arm/Assembler-arm.cpp
js/src/ion/arm/MacroAssembler-arm.cpp
js/src/ion/arm/Trampoline-arm.cpp
--- a/js/src/ion/arm/Assembler-arm.cpp
+++ b/js/src/ion/arm/Assembler-arm.cpp
@@ -391,20 +391,21 @@ ion::PatchJump(CodeLocationJump jump_, C
 void
 Assembler::finish()
 {
     JS_ASSERT(!isFinished);
     isFinished = true;
     for (size_t i = 0; i < jumps_.length(); i++) {
         jumps_[i].fixOffset(m_buffer);
     }
-    
+
     for (int i = 0; i < tmpDataRelocations_.length(); i++) {
         int offset = tmpDataRelocations_[i].getOffset();
-        dataRelocations_.writeUnsigned(offset + m_buffer.poolSizeBefore(offset));
+        int real_offset = offset + m_buffer.poolSizeBefore(offset);
+        dataRelocations_.writeUnsigned(real_offset);
     }
 }
 
 void
 Assembler::executableCopy(uint8 *buffer)
 {
     JS_ASSERT(isFinished);
     m_buffer.executableCopy(buffer);
--- a/js/src/ion/arm/MacroAssembler-arm.cpp
+++ b/js/src/ion/arm/MacroAssembler-arm.cpp
@@ -270,17 +270,17 @@ MacroAssemblerARM::ma_mov(Imm32 imm, Reg
 {
     ma_alu(InvalidReg, imm, dest, op_mov, sc, c);
 }
 
 void
 MacroAssemblerARM::ma_mov(const ImmGCPtr &ptr, Register dest)
 {
     writeDataRelocation(nextOffset());
-    ma_mov(Imm32(ptr.value), dest);
+    ma_movPatchable(Imm32(ptr.value), dest, Always, L_MOVWT);
 }
 
     // Shifts (just a move with a shifting op2)
 void
 MacroAssemblerARM::ma_lsl(Imm32 shift, Register src, Register dst)
 {
     as_mov(dst, lsl(src, shift.value));
 }
@@ -587,18 +587,18 @@ void
 MacroAssemblerARM::ma_cmp(Register src1, Imm32 imm, Condition c)
 {
     ma_alu(src1, imm, InvalidReg, op_cmp, SetCond, c);
 }
 
 void
 MacroAssemblerARM::ma_cmp(Register src1, ImmGCPtr ptr, Condition c)
 {
-    writeDataRelocation(nextOffset());
-    ma_alu(src1, Imm32(ptr.value), InvalidReg, op_cmp, SetCond, c);
+    ma_mov(ptr, ScratchRegister);
+    ma_cmp(src1, ScratchRegister, c);
 }
 void
 MacroAssemblerARM::ma_cmp(Register src1, Operand op, Condition c)
 {
     switch (op.getTag()) {
       case Operand::OP2:
         as_cmp(src1, op.toOp2(), c);
         break;
@@ -1227,17 +1227,16 @@ MacroAssemblerARMCompat::movePtr(const R
 void
 MacroAssemblerARMCompat::movePtr(const ImmWord &imm, const Register &dest)
 {
     ma_mov(Imm32(imm.value), dest);
 }
 void
 MacroAssemblerARMCompat::movePtr(const ImmGCPtr &imm, const Register &dest)
 {
-    writeDataRelocation(nextOffset());
     ma_mov(imm, dest);
 }
 void
 MacroAssemblerARMCompat::movePtr(const Address &src, const Register &dest)
 {
     loadPtr(src, dest);
 }
 
--- a/js/src/ion/arm/Trampoline-arm.cpp
+++ b/js/src/ion/arm/Trampoline-arm.cpp
@@ -345,17 +345,17 @@ IonCompartment::generateInvalidator(JSCo
 
 IonCode *
 IonCompartment::generateArgumentsRectifier(JSContext *cx)
 {
     MacroAssembler masm(cx);
     // ArgumentsRectifierReg contains the |nargs| pushed onto the current frame.
     // Including |this|, there are (|nargs| + 1) arguments to copy.
     JS_ASSERT(ArgumentsRectifierReg == r8);
-    
+
     // Load the number of |undefined|s to push into %rcx.
     masm.ma_ldr(DTRAddr(sp, DtrOffImm(IonJSFrameLayout::offsetOfCalleeToken())), r1);
     masm.ma_ldrh(EDtrAddr(r1, EDtrOffImm(offsetof(JSFunction, nargs))), r6);
 
     masm.ma_sub(r6, r8, r2);
 
     masm.moveValue(UndefinedValue(), r4, r5);