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.
This commit is contained in:
Mike Pall
2010-02-13 04:51:56 +01:00
parent 4f8d7be8ea
commit c93138b59e
34 changed files with 4410 additions and 4264 deletions

View File

@@ -238,7 +238,7 @@ void emit_peobj(BuildCtx *ctx)
for (relocsyms = 0; ctx->extnames[relocsyms]; relocsyms++) ;
pehdr.nsyms = 1+PEOBJ_NSECTIONS*2 + 1+(ctx->nsym-nzsym) + relocsyms;
#if !LJ_HASJIT
pehdr.nsyms -= 7;
pehdr.nsyms -= 11; /* See below, removes [IJ]* opcode symbols. */
#endif
#if LJ_TARGET_X64
pehdr.nsyms += 1; /* Symbol for lj_err_unwind_win64. */
@@ -353,8 +353,9 @@ void emit_peobj(BuildCtx *ctx)
} else {
#else
} else if (!(pi == BC_JFORI || pi == BC_JFORL || pi == BC_JITERL ||
pi == BC_JLOOP || pi == BC_IFORL || pi == BC_IITERL ||
pi == BC_ILOOP)) {
pi == BC_JLOOP || pi == BC_JFUNCF || pi == BC_JFUNCV ||
pi == BC_IFORL || pi == BC_IITERL || pi == BC_ILOOP ||
pi == BC_IFUNCF || pi == BC_IFUNCV)) {
#endif
sprintf(name, PEOBJ_SYM_PREFIX LABEL_PREFIX_BC "%s",
bc_names[pi]);