commit b8e76d9b5c86182998c0616627607181154a60b1
parent dc97a07e19abaa6942c84c88d001e8cccd517d1d
Author: Waldemar Celes <celes@tecgraf.puc-rio.br>
Date: Tue, 27 Dec 1994 18:52:56 -0200
'lua_getsubscript' and 'lua_storesubscript' now run unprotected (to improve efficiency)
Diffstat:
1 file changed, 6 insertions(+), 14 deletions(-)
diff --git a/opcode.c b/opcode.c
@@ -3,7 +3,7 @@
** TecCGraf - PUC-Rio
*/
-char *rcs_opcode="$Id: opcode.c,v 3.27 1994/12/16 16:08:34 roberto Exp roberto $";
+char *rcs_opcode="$Id: opcode.c,v 3.28 1994/12/20 21:20:36 roberto Exp celes $";
#include <setjmp.h>
#include <stdio.h>
@@ -441,16 +441,10 @@ lua_Object lua_setfallback (char *name, lua_CFunction fallback)
*/
lua_Object lua_getsubscript (void)
{
- static Byte code[2] = {PUSHINDEXED, RETCODE0};
- int status;
- Object func;
- tag(&func) = LUA_T_FUNCTION; bvalue(&func) = code;
adjustC(2);
- status = do_protectedrun(&func, 1);
- if (status == 0)
- return (Ref(top-1));
- else
- return LUA_NOOBJECT;
+ pushsubscript();
+ CBase++; /* incorporate object in the stack */
+ return (Ref(top-1));
}
@@ -487,11 +481,9 @@ void lua_endblock (void)
*/
int lua_storesubscript (void)
{
- static Byte code[2] = {STOREINDEXED0, RETCODE0};
- Object func;
- tag(&func) = LUA_T_FUNCTION; bvalue(&func) = code;
adjustC(3);
- return(do_protectedrun(&func, 0));
+ storesubscript();
+ return 0;
}
/*