diff options
author | Mike Pall <mike> | 2011-11-12 01:16:43 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2011-11-12 01:16:43 +0100 |
commit | 4d59752217148d81f01034161672b289c3d5ba22 (patch) | |
tree | 1a0fc14a7cfec1e6c3bbf93ef351556533682e87 /src/lj_target.h | |
parent | 635371c212a2d344df2aff80506ea51afdd065ef (diff) | |
download | luajit2-4d59752217148d81f01034161672b289c3d5ba22.tar.gz |
Avoid dependence on lj_jit.h if only including lj_target.h.
Diffstat (limited to 'src/lj_target.h')
-rw-r--r-- | src/lj_target.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lj_target.h b/src/lj_target.h index a80cc027..c302d301 100644 --- a/src/lj_target.h +++ b/src/lj_target.h @@ -144,12 +144,15 @@ typedef uint32_t RegCost; #ifdef EXITSTUBS_PER_GROUP /* Return the address of an exit stub. */ -static LJ_AINLINE MCode *exitstub_addr(jit_State *J, ExitNo exitno) +static LJ_AINLINE char *exitstub_addr_(char **group, uint32_t exitno) { - lua_assert(J->exitstubgroup[exitno / EXITSTUBS_PER_GROUP] != NULL); - return (MCode *)((char *)J->exitstubgroup[exitno / EXITSTUBS_PER_GROUP] + - EXITSTUB_SPACING*(exitno % EXITSTUBS_PER_GROUP)); + lua_assert(group[exitno / EXITSTUBS_PER_GROUP] != NULL); + return (char *)group[exitno / EXITSTUBS_PER_GROUP] + + EXITSTUB_SPACING*(exitno % EXITSTUBS_PER_GROUP); } +/* Avoid dependence on lj_jit.h if only including lj_target.h. */ +#define exitstub_addr(J, exitno) \ + ((MCode *)exitstub_addr_((char **)((J)->exitstubgroup), (exitno))) #endif #endif |