diff options
Diffstat (limited to 'src/lj_asm_mips.h')
-rw-r--r-- | src/lj_asm_mips.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index d0a1ca51..76311903 100644 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h | |||
@@ -65,10 +65,9 @@ static Reg ra_alloc2(ASMState *as, IRIns *ir, RegSet allow) | |||
65 | static void asm_sparejump_setup(ASMState *as) | 65 | static void asm_sparejump_setup(ASMState *as) |
66 | { | 66 | { |
67 | MCode *mxp = as->mcbot; | 67 | MCode *mxp = as->mcbot; |
68 | /* Assumes sizeof(MCLink) == 8. */ | 68 | if (((uintptr_t)mxp & (LJ_PAGESIZE-1)) == sizeof(MCLink)) { |
69 | if (((uintptr_t)mxp & (LJ_PAGESIZE-1)) == 8) { | ||
70 | lua_assert(MIPSI_NOP == 0); | 69 | lua_assert(MIPSI_NOP == 0); |
71 | memset(mxp+2, 0, MIPS_SPAREJUMP*8); | 70 | memset(mxp, 0, MIPS_SPAREJUMP*2*sizeof(MCode)); |
72 | mxp += MIPS_SPAREJUMP*2; | 71 | mxp += MIPS_SPAREJUMP*2; |
73 | lua_assert(mxp < as->mctop); | 72 | lua_assert(mxp < as->mctop); |
74 | lj_mcode_sync(as->mcbot, mxp); | 73 | lj_mcode_sync(as->mcbot, mxp); |
@@ -1947,7 +1946,9 @@ void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target) | |||
1947 | if (!cstart) cstart = p-1; | 1946 | if (!cstart) cstart = p-1; |
1948 | } else { /* Branch out of range. Use spare jump slot in mcarea. */ | 1947 | } else { /* Branch out of range. Use spare jump slot in mcarea. */ |
1949 | int i; | 1948 | int i; |
1950 | for (i = 2; i < 2+MIPS_SPAREJUMP*2; i += 2) { | 1949 | for (i = (int)(sizeof(MCLink)/sizeof(MCode)); |
1950 | i < (int)(sizeof(MCLink)/sizeof(MCode)+MIPS_SPAREJUMP*2); | ||
1951 | i += 2) { | ||
1951 | if (mcarea[i] == tjump) { | 1952 | if (mcarea[i] == tjump) { |
1952 | delta = mcarea+i - p; | 1953 | delta = mcarea+i - p; |
1953 | goto patchbranch; | 1954 | goto patchbranch; |