diff --git a/js/src/nanojit/LIR.cpp b/js/src/nanojit/LIR.cpp index 758a326b8d4..d2cc3b5246b 100755 --- a/js/src/nanojit/LIR.cpp +++ b/js/src/nanojit/LIR.cpp @@ -1544,12 +1544,16 @@ namespace nanojit } else { if (ref->isCall()) { +#if !defined NANOJIT_64BIT if (ref->isop(LIR_callh)) { // we've presumably seen the other half already ref = ref->oprnd1(); } else { +#endif copyName(ref, _functions[ref->fid()]._name, funccounts.add(ref->fid())); +#if !defined NANOJIT_64BIT } +#endif } else { NanoAssert(ref->opcode() < sizeof(lirNames) / sizeof(lirNames[0])); copyName(ref, lirNames[ref->opcode()], lircounts.add(ref->opcode())); diff --git a/js/src/nanojit/Nativei386.cpp b/js/src/nanojit/Nativei386.cpp index 3cac5679526..62bd1a1ee9c 100644 --- a/js/src/nanojit/Nativei386.cpp +++ b/js/src/nanojit/Nativei386.cpp @@ -878,8 +878,15 @@ namespace nanojit Register ra; // if this is last use of lhs in reg, we can re-use result reg - if (rA == 0 || (ra = rA->reg) == UnknownReg) + if (rA == 0 || (ra = rA->reg) == UnknownReg) { ra = findSpecificRegFor(lhs, rr); + } else if ((rmask(ra) & XmmRegs) == 0) { + /* We need this case on AMD64, because it's possible that + * an earlier instruction has done a quadword load and reserved a + * GPR. If so, ask for a new register. + */ + ra = findRegFor(lhs, XmmRegs); + } // else, rA already has a register assigned. static const AVMPLUS_ALIGN16(uint32_t) negateMask[] = {0,0x80000000,0,0}; @@ -975,8 +982,15 @@ namespace nanojit Register ra; // if this is last use of lhs in reg, we can re-use result reg - if (rA == 0 || (ra = rA->reg) == UnknownReg) + if (rA == 0 || (ra = rA->reg) == UnknownReg) { ra = findSpecificRegFor(lhs, rr); + } else if ((rmask(ra) & XmmRegs) == 0) { + /* We need this case on AMD64, because it's possible that + * an earlier instruction has done a quadword load and reserved a + * GPR. If so, ask for a new register. + */ + ra = findRegFor(lhs, XmmRegs); + } // else, rA already has a register assigned. if (lhs == rhs) diff --git a/js/src/trace-test.js b/js/src/trace-test.js index 5e244358766..68f2c6401d0 100644 --- a/js/src/trace-test.js +++ b/js/src/trace-test.js @@ -1178,7 +1178,7 @@ testNegZero1.name = 'testNegZero1'; testNegZero1Helper(1); test(testNegZero1); -/* No test case, just make sure this doesn't assert. */ +// No test case, just make sure this doesn't assert. function testNegZero2() { var z = 0; for (let j = 0; j < 5; ++j) { ({p: (-z)}); }