summaryrefslogtreecommitdiff
path: root/src/lib_jit.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-02-13 04:51:56 +0100
committerMike Pall <mike>2010-02-13 04:51:56 +0100
commitc93138b59e8f28b3d412cd7ec0c6631fd27e3e1b (patch)
tree8c0ffe2086ab0b032ed8e9f92ae6fb9d4d040d66 /src/lib_jit.c
parent4f8d7be8ea8a103f4d9046188d6005740b74f3d4 (diff)
downloadluajit2-c93138b59e8f28b3d412cd7ec0c6631fd27e3e1b.tar.gz
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.c8
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)
GCtab *t;
lua_createtable(L, 0, 16); /* Increment hash size if fields are added. */
t = tabV(L->top-1);
- setintfield(L, t, "linedefined", pt->linedefined);
+ setintfield(L, t, "linedefined", proto_line(pt, 0));
setintfield(L, t, "lastlinedefined", pt->lastlinedefined);
setintfield(L, t, "stackslots", pt->framesize);
setintfield(L, t, "params", pt->numparams);
@@ -185,9 +185,9 @@ LJLIB_CF(jit_util_funcinfo)
setintfield(L, t, "gcconsts", (int32_t)pt->sizekgc);
setintfield(L, t, "nconsts", (int32_t)pt->sizekn);
setintfield(L, t, "upvalues", (int32_t)pt->sizeuv);
- if (pc-1 < pt->sizebc)
+ if (pc < pt->sizebc)
setintfield(L, t, "currentline",
- proto_lineinfo(pt) ? proto_line(pt, pc-1) : 0);
+ proto_lineinfo(pt) ? proto_line(pt, pc) : 0);
lua_pushboolean(L, (pt->flags & PROTO_IS_VARARG));
lua_setfield(L, -2, "isvararg");
setstrV(L, L->top++, proto_chunkname(pt));
@@ -209,7 +209,7 @@ LJLIB_CF(jit_util_funcinfo)
LJLIB_CF(jit_util_funcbc)
{
GCproto *pt = check_Lproto(L, 0);
- BCPos pc = (BCPos)lj_lib_checkint(L, 2) - 1;
+ BCPos pc = (BCPos)lj_lib_checkint(L, 2);
if (pc < pt->sizebc) {
BCIns ins = proto_bc(pt)[pc];
BCOp op = bc_op(ins);