diff options
| -rw-r--r-- | ldebug.c | 4 | ||||
| -rw-r--r-- | ldo.c | 6 | ||||
| -rw-r--r-- | lfunc.c | 6 | ||||
| -rw-r--r-- | lgc.c | 6 | ||||
| -rw-r--r-- | lobject.h | 6 | ||||
| -rw-r--r-- | lparser.c | 4 | ||||
| -rw-r--r-- | lvm.c | 6 |
7 files changed, 19 insertions, 19 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldebug.c,v 1.19 2000/05/12 19:49:18 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 1.20 2000/05/15 19:30:41 roberto Exp roberto $ |
| 3 | ** Debug Interface | 3 | ** Debug Interface |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -89,7 +89,7 @@ static int lua_nups (StkId f) { | |||
| 89 | switch (ttype(f)) { | 89 | switch (ttype(f)) { |
| 90 | case TAG_LCLOSURE: case TAG_CCLOSURE: | 90 | case TAG_LCLOSURE: case TAG_CCLOSURE: |
| 91 | case TAG_LMARK: case TAG_CMARK: | 91 | case TAG_LMARK: case TAG_CMARK: |
| 92 | return f->value.cl->nelems; | 92 | return f->value.cl->nupvalues; |
| 93 | default: | 93 | default: |
| 94 | return 0; | 94 | return 0; |
| 95 | } | 95 | } |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 1.75 2000/05/09 14:50:16 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.76 2000/05/24 13:54:49 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -139,7 +139,7 @@ static void luaD_callHook (lua_State *L, StkId func, lua_Hook callhook, | |||
| 139 | 139 | ||
| 140 | 140 | ||
| 141 | static StkId callCclosure (lua_State *L, const struct Closure *cl, StkId base) { | 141 | static StkId callCclosure (lua_State *L, const struct Closure *cl, StkId base) { |
| 142 | int nup = cl->nelems; /* number of upvalues */ | 142 | int nup = cl->nupvalues; /* number of upvalues */ |
| 143 | int numarg = L->top-base; | 143 | int numarg = L->top-base; |
| 144 | struct C_Lua_Stack oldCLS = L->Cstack; | 144 | struct C_Lua_Stack oldCLS = L->Cstack; |
| 145 | StkId firstResult; | 145 | StkId firstResult; |
| @@ -151,7 +151,7 @@ static StkId callCclosure (lua_State *L, const struct Closure *cl, StkId base) { | |||
| 151 | L->top += nup; | 151 | L->top += nup; |
| 152 | numarg += nup; | 152 | numarg += nup; |
| 153 | /* copy upvalues into stack */ | 153 | /* copy upvalues into stack */ |
| 154 | while (nup--) *(base+nup) = cl->consts[nup]; | 154 | while (nup--) *(base+nup) = cl->upvalue[nup]; |
| 155 | } | 155 | } |
| 156 | L->Cstack.num = numarg; | 156 | L->Cstack.num = numarg; |
| 157 | L->Cstack.lua2C = base; | 157 | L->Cstack.lua2C = base; |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lfunc.c,v 1.21 2000/03/29 20:19:20 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 1.22 2000/05/24 13:54:49 roberto Exp roberto $ |
| 3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -14,7 +14,7 @@ | |||
| 14 | #include "lstate.h" | 14 | #include "lstate.h" |
| 15 | 15 | ||
| 16 | #define gcsizeproto(L, p) numblocks(L, 0, sizeof(Proto)) | 16 | #define gcsizeproto(L, p) numblocks(L, 0, sizeof(Proto)) |
| 17 | #define gcsizeclosure(L, c) numblocks(L, c->nelems, sizeof(Closure)) | 17 | #define gcsizeclosure(L, c) numblocks(L, c->nupvalues, sizeof(Closure)) |
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | 20 | ||
| @@ -24,7 +24,7 @@ Closure *luaF_newclosure (lua_State *L, int nelems) { | |||
| 24 | c->next = L->rootcl; | 24 | c->next = L->rootcl; |
| 25 | L->rootcl = c; | 25 | L->rootcl = c; |
| 26 | c->marked = 0; | 26 | c->marked = 0; |
| 27 | c->nelems = nelems; | 27 | c->nupvalues = nelems; |
| 28 | L->nblocks += gcsizeclosure(L, c); | 28 | L->nblocks += gcsizeclosure(L, c); |
| 29 | return c; | 29 | return c; |
| 30 | } | 30 | } |
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lgc.c,v 1.51 2000/05/24 13:54:49 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 1.52 2000/05/30 18:54:49 roberto Exp roberto $ |
| 3 | ** Garbage Collector | 3 | ** Garbage Collector |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -44,10 +44,10 @@ static void protomark (lua_State *L, Proto *f) { | |||
| 44 | 44 | ||
| 45 | static void closuremark (lua_State *L, Closure *f) { | 45 | static void closuremark (lua_State *L, Closure *f) { |
| 46 | if (!f->marked) { | 46 | if (!f->marked) { |
| 47 | int i = f->nelems; | 47 | int i = f->nupvalues; |
| 48 | f->marked = 1; | 48 | f->marked = 1; |
| 49 | while (i--) | 49 | while (i--) |
| 50 | markobject(L, &f->consts[i]); | 50 | markobject(L, &f->upvalue[i]); |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | 53 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 1.64 2000/05/10 16:33:20 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.65 2000/05/24 13:54:49 roberto Exp roberto $ |
| 3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -144,8 +144,8 @@ typedef struct Closure { | |||
| 144 | lua_CFunction c; /* C functions */ | 144 | lua_CFunction c; /* C functions */ |
| 145 | struct Proto *l; /* Lua functions */ | 145 | struct Proto *l; /* Lua functions */ |
| 146 | } f; | 146 | } f; |
| 147 | int nelems; | 147 | int nupvalues; |
| 148 | TObject consts[1]; | 148 | TObject upvalue[1]; |
| 149 | } Closure; | 149 | } Closure; |
| 150 | 150 | ||
| 151 | 151 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lparser.c,v 1.91 2000/05/25 18:26:42 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 1.92 2000/05/25 18:59:59 roberto Exp roberto $ |
| 3 | ** LL(1) Parser and code generator for Lua | 3 | ** LL(1) Parser and code generator for Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -170,7 +170,7 @@ static int checkname (LexState *ls) { | |||
| 170 | 170 | ||
| 171 | 171 | ||
| 172 | static TString *str_checkname (LexState *ls) { | 172 | static TString *str_checkname (LexState *ls) { |
| 173 | int i = checkname(ls); /* this call may realloc `f->consts' */ | 173 | int i = checkname(ls); /* this call may realloc `f->kstr' */ |
| 174 | return ls->fs->f->kstr[i]; | 174 | return ls->fs->f->kstr[i]; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 1.108 2000/05/24 13:54:49 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.109 2000/05/25 19:02:21 roberto Exp roberto $ |
| 3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -77,7 +77,7 @@ static Closure *luaV_closure (lua_State *L, lua_Type t, int nelems) { | |||
| 77 | Closure *c = luaF_newclosure(L, nelems); | 77 | Closure *c = luaF_newclosure(L, nelems); |
| 78 | L->top -= nelems; | 78 | L->top -= nelems; |
| 79 | while (nelems--) | 79 | while (nelems--) |
| 80 | c->consts[nelems] = *(L->top+nelems); | 80 | c->upvalue[nelems] = *(L->top+nelems); |
| 81 | ttype(L->top) = t; | 81 | ttype(L->top) = t; |
| 82 | clvalue(L->top) = c; | 82 | clvalue(L->top) = c; |
| 83 | incr_top; | 83 | incr_top; |
| @@ -409,7 +409,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) { | |||
| 409 | break; | 409 | break; |
| 410 | 410 | ||
| 411 | case OP_PUSHUPVALUE: | 411 | case OP_PUSHUPVALUE: |
| 412 | *top++ = cl->consts[GETARG_U(i)]; | 412 | *top++ = cl->upvalue[GETARG_U(i)]; |
| 413 | break; | 413 | break; |
| 414 | 414 | ||
| 415 | case OP_GETLOCAL: | 415 | case OP_GETLOCAL: |
