diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-12 15:32:40 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-12 15:32:40 -0300 |
| commit | 41259bff31dbb904edfb8070006ccb15577f8f04 (patch) | |
| tree | 664bf9cbe6394e9074435ecf2bd710712b4537c3 /opcode.c | |
| parent | afaa98a666acd5f596b50f56bb288815838c096e (diff) | |
| download | lua-41259bff31dbb904edfb8070006ccb15577f8f04.tar.gz lua-41259bff31dbb904edfb8070006ccb15577f8f04.tar.bz2 lua-41259bff31dbb904edfb8070006ccb15577f8f04.zip | |
BIG CHANGE: new data structure for constants, strings and globals, using
an array of hash tables for all them.
Diffstat (limited to 'opcode.c')
| -rw-r--r-- | opcode.c | 15 |
1 files changed, 2 insertions, 13 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_opcode="$Id: opcode.c,v 3.55 1996/02/07 18:10:27 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.56 1996/02/08 17:03:20 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
| 9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
| @@ -381,7 +381,7 @@ static void getglobal (Word n) | |||
| 381 | if (tag(top-1) == LUA_T_NIL) | 381 | if (tag(top-1) == LUA_T_NIL) |
| 382 | { /* must call getglobal fallback */ | 382 | { /* must call getglobal fallback */ |
| 383 | tag(top-1) = LUA_T_STRING; | 383 | tag(top-1) = LUA_T_STRING; |
| 384 | tsvalue(top-1) = &lua_table[n].varname->ts; | 384 | tsvalue(top-1) = lua_table[n].varname; |
| 385 | callFB(FB_GETGLOBAL); | 385 | callFB(FB_GETGLOBAL); |
| 386 | } | 386 | } |
| 387 | } | 387 | } |
| @@ -792,17 +792,6 @@ void lua_pushstring (char *s) | |||
| 792 | } | 792 | } |
| 793 | 793 | ||
| 794 | /* | 794 | /* |
| 795 | ** Push an object (tag=string) on stack and register it on the constant table. | ||
| 796 | */ | ||
| 797 | void lua_pushliteral (char *s) | ||
| 798 | { | ||
| 799 | Word ct = luaI_findconstantbyname(s); /* this call may change lua_constant */ | ||
| 800 | tsvalue(top) = lua_constant[ct]; | ||
| 801 | tag(top) = LUA_T_STRING; | ||
| 802 | incr_top; | ||
| 803 | } | ||
| 804 | |||
| 805 | /* | ||
| 806 | ** Push an object (tag=cfunction) to stack. | 795 | ** Push an object (tag=cfunction) to stack. |
| 807 | */ | 796 | */ |
| 808 | void lua_pushcfunction (lua_CFunction fn) | 797 | void lua_pushcfunction (lua_CFunction fn) |
