summaryrefslogtreecommitdiff
path: root/src/lib_package.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_package.c
parent4f8d7be8ea8a103f4d9046188d6005740b74f3d4 (diff)
downloadluajit-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_package.c')
-rw-r--r--src/lib_package.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib_package.c b/src/lib_package.c
index 7d0362a5..6d093500 100644
--- a/src/lib_package.c
+++ b/src/lib_package.c
@@ -482,14 +482,14 @@ LUALIB_API int luaopen_package(lua_State *L)
482{ 482{
483 int i; 483 int i;
484 luaL_newmetatable(L, "_LOADLIB"); 484 luaL_newmetatable(L, "_LOADLIB");
485 lua_pushcfunction(L, lj_cf_package_unloadlib); 485 lj_lib_pushcf(L, lj_cf_package_unloadlib, 1);
486 lua_setfield(L, -2, "__gc"); 486 lua_setfield(L, -2, "__gc");
487 luaL_register(L, LUA_LOADLIBNAME, package_lib); 487 luaL_register(L, LUA_LOADLIBNAME, package_lib);
488 lua_pushvalue(L, -1); 488 lua_pushvalue(L, -1);
489 lua_replace(L, LUA_ENVIRONINDEX); 489 lua_replace(L, LUA_ENVIRONINDEX);
490 lua_createtable(L, sizeof(package_loaders)/sizeof(package_loaders[0])-1, 0); 490 lua_createtable(L, sizeof(package_loaders)/sizeof(package_loaders[0])-1, 0);
491 for (i = 0; package_loaders[i] != NULL; i++) { 491 for (i = 0; package_loaders[i] != NULL; i++) {
492 lua_pushcfunction(L, package_loaders[i]); 492 lj_lib_pushcf(L, package_loaders[i], 1);
493 lua_rawseti(L, -2, i+1); 493 lua_rawseti(L, -2, i+1);
494 } 494 }
495 lua_setfield(L, -2, "loaders"); 495 lua_setfield(L, -2, "loaders");