Bug 1492912 : [MIPS] Make MacroAssemblerMIPSCompat::tagValue not assert if the payload is the same as output type register; r=froydnj
authordragan.mladjenovic <dragan.mladjenovic@rt-rk.com>
Thu, 20 Sep 2018 10:35:00 +0300
changeset 487712 ac7be31e4ad61f8e35f87ce95952415ae4f52896
parent 487711 b41f84a1a1e2607875fcfa51b9fb2d1ff4d19598
child 487713 27ba9965ff0aa4224c22b72aeae19cf8f6e09aa8
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersfroydnj
bugs1492912
milestone64.0a1
Bug 1492912 : [MIPS] Make MacroAssemblerMIPSCompat::tagValue not assert if the payload is the same as output type register; r=froydnj
js/src/jit/mips32/MacroAssembler-mips32.cpp
--- a/js/src/jit/mips32/MacroAssembler-mips32.cpp
+++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ -1771,21 +1771,21 @@ MacroAssemblerMIPSCompat::loadValue(Addr
         ma_lw(val.typeReg(), Address(src.base, src.offset + TAG_OFFSET));
         ma_lw(val.payloadReg(), Address(src.base, src.offset + PAYLOAD_OFFSET));
     }
 }
 
 void
 MacroAssemblerMIPSCompat::tagValue(JSValueType type, Register payload, ValueOperand dest)
 {
-    MOZ_ASSERT(payload != dest.typeReg());
-    ma_li(dest.typeReg(), ImmType(type));
+    MOZ_ASSERT(dest.typeReg() != dest.payloadReg());
     if (payload != dest.payloadReg()) {
         ma_move(dest.payloadReg(), payload);
     }
+    ma_li(dest.typeReg(), ImmType(type));
 }
 
 void
 MacroAssemblerMIPSCompat::pushValue(ValueOperand val)
 {
     // Allocate stack slots for type and payload. One for each.
     asMasm().subPtr(Imm32(sizeof(Value)), StackPointer);
     // Store type and payload.