aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2011-11-12 01:16:43 +0100
committerMike Pall <mike>2011-11-12 01:16:43 +0100
commit4d59752217148d81f01034161672b289c3d5ba22 (patch)
tree1a0fc14a7cfec1e6c3bbf93ef351556533682e87
parent635371c212a2d344df2aff80506ea51afdd065ef (diff)
downloadluajit-4d59752217148d81f01034161672b289c3d5ba22.tar.gz
luajit-4d59752217148d81f01034161672b289c3d5ba22.tar.bz2
luajit-4d59752217148d81f01034161672b289c3d5ba22.zip
Avoid dependence on lj_jit.h if only including lj_target.h.
-rw-r--r--src/lj_target.h11
-rw-r--r--src/lj_target_ppc.h7
2 files changed, 11 insertions, 7 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;
144 144
145#ifdef EXITSTUBS_PER_GROUP 145#ifdef EXITSTUBS_PER_GROUP
146/* Return the address of an exit stub. */ 146/* Return the address of an exit stub. */
147static LJ_AINLINE MCode *exitstub_addr(jit_State *J, ExitNo exitno) 147static LJ_AINLINE char *exitstub_addr_(char **group, uint32_t exitno)
148{ 148{
149 lua_assert(J->exitstubgroup[exitno / EXITSTUBS_PER_GROUP] != NULL); 149 lua_assert(group[exitno / EXITSTUBS_PER_GROUP] != NULL);
150 return (MCode *)((char *)J->exitstubgroup[exitno / EXITSTUBS_PER_GROUP] + 150 return (char *)group[exitno / EXITSTUBS_PER_GROUP] +
151 EXITSTUB_SPACING*(exitno % EXITSTUBS_PER_GROUP)); 151 EXITSTUB_SPACING*(exitno % EXITSTUBS_PER_GROUP);
152} 152}
153/* Avoid dependence on lj_jit.h if only including lj_target.h. */
154#define exitstub_addr(J, exitno) \
155 ((MCode *)exitstub_addr_((char **)((J)->exitstubgroup), (exitno)))
153#endif 156#endif
154 157
155#endif 158#endif
diff --git a/src/lj_target_ppc.h b/src/lj_target_ppc.h
index f754a8d3..d8fbea6d 100644
--- a/src/lj_target_ppc.h
+++ b/src/lj_target_ppc.h
@@ -112,13 +112,14 @@ typedef struct {
112#define EXITSTATE_CHECKEXIT 1 112#define EXITSTATE_CHECKEXIT 1
113 113
114/* Return the address of a per-trace exit stub. */ 114/* Return the address of a per-trace exit stub. */
115static LJ_AINLINE MCode *exitstub_trace_addr(GCtrace *T, ExitNo exitno) 115static LJ_AINLINE uint32_t *exitstub_trace_addr_(uint32_t *p, uint32_t exitno)
116{ 116{
117 /* Keep this in-sync with asm_exitstub_*. */
118 MCode *p = (MCode *)((char *)T->mcode + T->szmcode);
119 while (*p == 0x60000000) p++; /* Skip PPCI_NOP. */ 117 while (*p == 0x60000000) p++; /* Skip PPCI_NOP. */
120 return p + 3 + exitno; 118 return p + 3 + exitno;
121} 119}
120/* Avoid dependence on lj_jit.h if only including lj_target.h. */
121#define exitstub_trace_addr(T, exitno) \
122 exitstub_trace_addr_((MCode *)((char *)(T)->mcode + (T)->szmcode), (exitno))
122 123
123/* -- Instructions -------------------------------------------------------- */ 124/* -- Instructions -------------------------------------------------------- */
124 125