diff options
author | Mike Pall <mike> | 2010-02-13 04:51:56 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-02-13 04:51:56 +0100 |
commit | c93138b59e8f28b3d412cd7ec0c6631fd27e3e1b (patch) | |
tree | 8c0ffe2086ab0b032ed8e9f92ae6fb9d4d040d66 /src/lib_jit.c | |
parent | 4f8d7be8ea8a103f4d9046188d6005740b74f3d4 (diff) | |
download | luajit-c93138b59e8f28b3d412cd7ec0c6631fd27e3e1b.tar.gz luajit-c93138b59e8f28b3d412cd7ec0c6631fd27e3e1b.tar.bz2 luajit-c93138b59e8f28b3d412cd7ec0c6631fd27e3e1b.zip |
Major redesign of function call handling.
Drop call gates. Use function headers, dispatched like bytecodes.
Emit BC_FUNCF/BC_FUNCV bytecode at PC 0 for all Lua functions.
C functions and ASM fast functions get extra bytecodes.
Modify internal calling convention: new base in BASE (formerly in RA).
Can now use better C function wrapper semantics (dynamic on/off).
Prerequisite for call hooks with zero-overhead if disabled.
Prerequisite for compiling recursive calls.
Prerequisite for efficient 32/64 bit prototype guards.
Diffstat (limited to 'src/lib_jit.c')
-rw-r--r-- | src/lib_jit.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib_jit.c b/src/lib_jit.c index 8fda41d0..a5829dc3 100644 --- a/src/lib_jit.c +++ b/src/lib_jit.c | |||
@@ -177,7 +177,7 @@ LJLIB_CF(jit_util_funcinfo) | |||
177 | GCtab *t; | 177 | GCtab *t; |
178 | lua_createtable(L, 0, 16); /* Increment hash size if fields are added. */ | 178 | lua_createtable(L, 0, 16); /* Increment hash size if fields are added. */ |
179 | t = tabV(L->top-1); | 179 | t = tabV(L->top-1); |
180 | setintfield(L, t, "linedefined", pt->linedefined); | 180 | setintfield(L, t, "linedefined", proto_line(pt, 0)); |
181 | setintfield(L, t, "lastlinedefined", pt->lastlinedefined); | 181 | setintfield(L, t, "lastlinedefined", pt->lastlinedefined); |
182 | setintfield(L, t, "stackslots", pt->framesize); | 182 | setintfield(L, t, "stackslots", pt->framesize); |
183 | setintfield(L, t, "params", pt->numparams); | 183 | setintfield(L, t, "params", pt->numparams); |
@@ -185,9 +185,9 @@ LJLIB_CF(jit_util_funcinfo) | |||
185 | setintfield(L, t, "gcconsts", (int32_t)pt->sizekgc); | 185 | setintfield(L, t, "gcconsts", (int32_t)pt->sizekgc); |
186 | setintfield(L, t, "nconsts", (int32_t)pt->sizekn); | 186 | setintfield(L, t, "nconsts", (int32_t)pt->sizekn); |
187 | setintfield(L, t, "upvalues", (int32_t)pt->sizeuv); | 187 | setintfield(L, t, "upvalues", (int32_t)pt->sizeuv); |
188 | if (pc-1 < pt->sizebc) | 188 | if (pc < pt->sizebc) |
189 | setintfield(L, t, "currentline", | 189 | setintfield(L, t, "currentline", |
190 | proto_lineinfo(pt) ? proto_line(pt, pc-1) : 0); | 190 | proto_lineinfo(pt) ? proto_line(pt, pc) : 0); |
191 | lua_pushboolean(L, (pt->flags & PROTO_IS_VARARG)); | 191 | lua_pushboolean(L, (pt->flags & PROTO_IS_VARARG)); |
192 | lua_setfield(L, -2, "isvararg"); | 192 | lua_setfield(L, -2, "isvararg"); |
193 | setstrV(L, L->top++, proto_chunkname(pt)); | 193 | setstrV(L, L->top++, proto_chunkname(pt)); |
@@ -209,7 +209,7 @@ LJLIB_CF(jit_util_funcinfo) | |||
209 | LJLIB_CF(jit_util_funcbc) | 209 | LJLIB_CF(jit_util_funcbc) |
210 | { | 210 | { |
211 | GCproto *pt = check_Lproto(L, 0); | 211 | GCproto *pt = check_Lproto(L, 0); |
212 | BCPos pc = (BCPos)lj_lib_checkint(L, 2) - 1; | 212 | BCPos pc = (BCPos)lj_lib_checkint(L, 2); |
213 | if (pc < pt->sizebc) { | 213 | if (pc < pt->sizebc) { |
214 | BCIns ins = proto_bc(pt)[pc]; | 214 | BCIns ins = proto_bc(pt)[pc]; |
215 | BCOp op = bc_op(ins); | 215 | BCOp op = bc_op(ins); |