From a44bc58f906268f9f9dfe94c869cfea1a657f5eb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 19 Aug 2008 21:31:23 -0700 Subject: [PATCH] More AMD64 fixes (release build works now, and fixed verbosity bug). --- js/src/nanojit/Fragmento.h | 2 +- js/src/nanojit/LIR.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/js/src/nanojit/Fragmento.h b/js/src/nanojit/Fragmento.h index 36cb367126..d0e0c3c543 100644 --- a/js/src/nanojit/Fragmento.h +++ b/js/src/nanojit/Fragmento.h @@ -238,7 +238,7 @@ namespace nanojit #else inline int nbr(LInsp x) { - return int(x) & (NJ_PAGE_SIZE-1); + return (int)(intptr_t(x) & intptr_t(NJ_PAGE_SIZE-1)); } #endif } diff --git a/js/src/nanojit/LIR.cpp b/js/src/nanojit/LIR.cpp index c91ae0d401..baddb79c59 100755 --- a/js/src/nanojit/LIR.cpp +++ b/js/src/nanojit/LIR.cpp @@ -50,7 +50,11 @@ namespace nanojit /* 10 */ /*param*/0, 2, 2, 2, 2, 2, 2, 2, /*call*/0, /*loop*/0, /* 20 */ /*x*/0, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 30 */ 2, 2, /*short*/0, /*int*/0, 2, 2, /*neg*/1, 2, 2, 2, +#if defined NANOJIT_64BIT + /* 40 */ /*callh*/0, 2, 2, 2, /*not*/1, 2, 2, 2, /*xt*/1, /*xf*/1, +#else /* 40 */ /*callh*/1, 2, 2, 2, /*not*/1, 2, 2, 2, /*xt*/1, /*xf*/1, +#endif /* 50 */ /*qlo*/1, /*qhi*/1, 2, /*ov*/1, /*cs*/1, 2, 2, 2, 2, 2, /* 60 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 70 */ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -1357,6 +1361,7 @@ namespace nanojit } void add(LInsp i, LInsp use) { if (!i->isconst() && !i->isconstq() && !live.containsKey(i)) { + NanoAssert(i->opcode() < sizeof(lirNames) / sizeof(lirNames[0])); live.put(i,use); } } @@ -1411,6 +1416,7 @@ namespace nanojit if (live.contains(i)) { live.retire(i,gc); + NanoAssert(i->opcode() < sizeof(operandCount) / sizeof(operandCount[0])); if (i->isStore()) { live.add(i->oprnd2(),i); // base live.add(i->oprnd1(),i); // val @@ -1525,6 +1531,7 @@ namespace nanojit if (ref->isCall()) { copyName(ref, _functions[ref->fid()]._name, funccounts.add(ref->fid())); } else { + NanoAssert(ref->opcode() < sizeof(lirNames) / sizeof(lirNames[0])); copyName(ref, lirNames[ref->opcode()], lircounts.add(ref->opcode())); } StringNullTerminatedUTF8 cname(gc, names.get(ref)->name); -- 2.11.4.GIT