Bug 1113018. Stop manually moving things into ScratchReg in the x86-64 version of extractObject; just rely on unboxNonDouble doing the right thing as needed. r=sunfish
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 02 Jan 2015 17:09:14 -0500
changeset 221919 936b4df5458073dc1a05f7b8384a6283c75685da
parent 221918 576a73e44f6341c8385c2c7b034975d0d178dd0b
child 221920 cbf65998682c1a1ed036652c25d9f0f9193be085
push id28050
push userphilringnalda@gmail.com
push dateSun, 04 Jan 2015 04:02:52 +0000
treeherdermozilla-central@55f3224d7513 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssunfish
bugs1113018
milestone37.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 1113018. Stop manually moving things into ScratchReg in the x86-64 version of extractObject; just rely on unboxNonDouble doing the right thing as needed. r=sunfish
js/src/jit/x64/MacroAssembler-x64.h
--- a/js/src/jit/x64/MacroAssembler-x64.h
+++ b/js/src/jit/x64/MacroAssembler-x64.h
@@ -1160,19 +1160,16 @@ class MacroAssemblerX64 : public MacroAs
 
     void notBoolean(const ValueOperand &val) {
         xorq(Imm32(1), val.valueReg());
     }
 
     // Unbox any non-double value into dest. Prefer unboxInt32 or unboxBoolean
     // instead if the source type is known.
     void unboxNonDouble(const ValueOperand &src, Register dest) {
-        // In a non-trivial coupling, we're not permitted to use ScratchReg when
-        // src and dest are different registers, because of how extractObject is
-        // implemented.
         if (src.valueReg() == dest) {
             mov(ImmWord(JSVAL_PAYLOAD_MASK), ScratchReg);
             andq(ScratchReg, dest);
         } else {
             mov(ImmWord(JSVAL_PAYLOAD_MASK), dest);
             andq(src.valueReg(), dest);
         }
     }
@@ -1203,20 +1200,17 @@ class MacroAssemblerX64 : public MacroAs
     void unboxObject(const Address &src, Register dest) { unboxNonDouble(Operand(src), dest); }
     void unboxObject(const BaseIndex &src, Register dest) { unboxNonDouble(Operand(src), dest); }
 
     // Extended unboxing API. If the payload is already in a register, returns
     // that register. Otherwise, provides a move to the given scratch register,
     // and returns that.
     Register extractObject(const Address &address, Register scratch) {
         MOZ_ASSERT(scratch != ScratchReg);
-        loadPtr(address, ScratchReg);
-        // We have a special coupling with unboxObject. As long as the registers
-        // aren't equal, it doesn't use ScratchReg.
-        unboxObject(ValueOperand(ScratchReg), scratch);
+        unboxObject(address, scratch);
         return scratch;
     }
     Register extractObject(const ValueOperand &value, Register scratch) {
         MOZ_ASSERT(scratch != ScratchReg);
         unboxObject(value, scratch);
         return scratch;
     }
     Register extractInt32(const ValueOperand &value, Register scratch) {