diff options
author | Mike Pall <mike> | 2013-04-05 20:24:24 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2013-04-05 20:24:24 +0200 |
commit | 48912a2dea496e6640db75a261b105182ddbb7a6 (patch) | |
tree | 2429c31c6b38bce93ae0a470a99d8a17c17a3210 | |
parent | ac14d88030a8af1e2c56f8c4721872dd9a799abb (diff) | |
parent | b5bbacdc17815bbf1c6353322a7eb85cd3994399 (diff) | |
download | luajit-48912a2dea496e6640db75a261b105182ddbb7a6.tar.gz luajit-48912a2dea496e6640db75a261b105182ddbb7a6.tar.bz2 luajit-48912a2dea496e6640db75a261b105182ddbb7a6.zip |
Merge branch 'master' into v2.1
-rw-r--r-- | src/lj_mcode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_mcode.c b/src/lj_mcode.c index 5f7582c4..cb79e8cd 100644 --- a/src/lj_mcode.c +++ b/src/lj_mcode.c | |||
@@ -206,6 +206,7 @@ static void *mcode_alloc(jit_State *J, size_t sz) | |||
206 | { | 206 | { |
207 | /* Target an address in the static assembler code (64K aligned). | 207 | /* Target an address in the static assembler code (64K aligned). |
208 | ** Try addresses within a distance of target-range/2+1MB..target+range/2-1MB. | 208 | ** Try addresses within a distance of target-range/2+1MB..target+range/2-1MB. |
209 | ** Use half the jump range so every address in the range can reach any other. | ||
209 | */ | 210 | */ |
210 | #if LJ_TARGET_MIPS | 211 | #if LJ_TARGET_MIPS |
211 | /* Use the middle of the 256MB-aligned region. */ | 212 | /* Use the middle of the 256MB-aligned region. */ |
@@ -214,7 +215,7 @@ static void *mcode_alloc(jit_State *J, size_t sz) | |||
214 | #else | 215 | #else |
215 | uintptr_t target = (uintptr_t)(void *)lj_vm_exit_handler & ~(uintptr_t)0xffff; | 216 | uintptr_t target = (uintptr_t)(void *)lj_vm_exit_handler & ~(uintptr_t)0xffff; |
216 | #endif | 217 | #endif |
217 | const uintptr_t range = (1u << LJ_TARGET_JUMPRANGE) - (1u << 21); | 218 | const uintptr_t range = (1u << (LJ_TARGET_JUMPRANGE-1)) - (1u << 21); |
218 | /* First try a contiguous area below the last one. */ | 219 | /* First try a contiguous area below the last one. */ |
219 | uintptr_t hint = J->mcarea ? (uintptr_t)J->mcarea - sz : 0; | 220 | uintptr_t hint = J->mcarea ? (uintptr_t)J->mcarea - sz : 0; |
220 | int i; | 221 | int i; |