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/lj_func.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/lj_func.c')
-rw-r--r-- | src/lj_func.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lj_func.c b/src/lj_func.c index 7d130176..3766b25e 100644 --- a/src/lj_func.c +++ b/src/lj_func.c | |||
@@ -101,8 +101,8 @@ GCfunc *lj_func_newC(lua_State *L, MSize nelems, GCtab *env) | |||
101 | fn->c.ffid = FF_C; | 101 | fn->c.ffid = FF_C; |
102 | fn->c.nupvalues = cast_byte(nelems); | 102 | fn->c.nupvalues = cast_byte(nelems); |
103 | /* NOBARRIER: The GCfunc is new (marked white). */ | 103 | /* NOBARRIER: The GCfunc is new (marked white). */ |
104 | setmref(fn->c.pc, &G(L)->bc_cfunc_ext); | ||
104 | setgcref(fn->c.env, obj2gco(env)); | 105 | setgcref(fn->c.env, obj2gco(env)); |
105 | fn->c.gate = G(L)->wrapmode ? lj_gate_cwrap : lj_gate_c; | ||
106 | return fn; | 106 | return fn; |
107 | } | 107 | } |
108 | 108 | ||
@@ -115,7 +115,6 @@ GCfunc *lj_func_newL(lua_State *L, GCproto *pt, GCtab *env) | |||
115 | /* NOBARRIER: Really a setgcref. But the GCfunc is new (marked white). */ | 115 | /* NOBARRIER: Really a setgcref. But the GCfunc is new (marked white). */ |
116 | setmref(fn->l.pc, proto_bc(pt)); | 116 | setmref(fn->l.pc, proto_bc(pt)); |
117 | setgcref(fn->l.env, obj2gco(env)); | 117 | setgcref(fn->l.env, obj2gco(env)); |
118 | fn->l.gate = (pt->flags & PROTO_IS_VARARG) ? lj_gate_lv : lj_gate_lf; | ||
119 | return fn; | 118 | return fn; |
120 | } | 119 | } |
121 | 120 | ||