rename of `kproto' to `p'

This commit is contained in:
Roberto Ierusalimschy 2001-06-28 11:57:17 -03:00
parent b346834a09
commit 770954510f
7 changed files with 24 additions and 24 deletions

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ldebug.c,v 1.83 2001/06/15 20:36:57 roberto Exp roberto $ ** $Id: ldebug.c,v 1.84 2001/06/26 13:20:45 roberto Exp roberto $
** Debug Interface ** Debug Interface
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -450,8 +450,8 @@ static Instruction luaG_symbexec (const Proto *pt, int lastpc, int reg) {
break; break;
} }
case OP_CLOSURE: { case OP_CLOSURE: {
check(b < pt->sizekproto); check(b < pt->sizep);
checkreg(pt, a + pt->kproto[b]->nupvalues - 1); checkreg(pt, a + pt->p[b]->nupvalues - 1);
break; break;
} }
default: break; default: break;

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lfunc.c,v 1.43 2001/03/26 14:31:49 roberto Exp roberto $ ** $Id: lfunc.c,v 1.44 2001/06/05 18:17:01 roberto Exp roberto $
** Auxiliary functions to manipulate prototypes and closures ** Auxiliary functions to manipulate prototypes and closures
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -32,8 +32,8 @@ Proto *luaF_newproto (lua_State *L) {
Proto *f = luaM_new(L, Proto); Proto *f = luaM_new(L, Proto);
f->k = NULL; f->k = NULL;
f->sizek = 0; f->sizek = 0;
f->kproto = NULL; f->p = NULL;
f->sizekproto = 0; f->sizep = 0;
f->code = NULL; f->code = NULL;
f->sizecode = 0; f->sizecode = 0;
f->nupvalues = 0; f->nupvalues = 0;
@ -57,7 +57,7 @@ void luaF_freeproto (lua_State *L, Proto *f) {
luaM_freearray(L, f->code, f->sizecode, Instruction); luaM_freearray(L, f->code, f->sizecode, Instruction);
luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar); luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar);
luaM_freearray(L, f->k, f->sizek, TObject); luaM_freearray(L, f->k, f->sizek, TObject);
luaM_freearray(L, f->kproto, f->sizekproto, Proto *); luaM_freearray(L, f->p, f->sizep, Proto *);
luaM_freearray(L, f->lineinfo, f->sizelineinfo, int); luaM_freearray(L, f->lineinfo, f->sizelineinfo, int);
luaM_freelem(L, f, Proto); luaM_freelem(L, f, Proto);
} }

6
lgc.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lgc.c,v 1.107 2001/06/21 16:41:34 roberto Exp roberto $ ** $Id: lgc.c,v 1.108 2001/06/26 13:20:45 roberto Exp roberto $
** Garbage Collector ** Garbage Collector
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -40,8 +40,8 @@ static void protomark (Proto *f) {
if (ttype(f->k+i) == LUA_TSTRING) if (ttype(f->k+i) == LUA_TSTRING)
strmark(tsvalue(f->k+i)); strmark(tsvalue(f->k+i));
} }
for (i=0; i<f->sizekproto; i++) for (i=0; i<f->sizep; i++)
protomark(f->kproto[i]); protomark(f->p[i]);
for (i=0; i<f->sizelocvars; i++) /* mark local-variable names */ for (i=0; i<f->sizelocvars; i++) /* mark local-variable names */
strmark(f->locvars[i].varname); strmark(f->locvars[i].varname);
} }

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lobject.h,v 1.107 2001/06/26 13:20:45 roberto Exp roberto $ ** $Id: lobject.h,v 1.108 2001/06/28 14:48:44 roberto Exp roberto $
** Type definitions for Lua objects ** Type definitions for Lua objects
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -124,8 +124,8 @@ typedef union Udata {
typedef struct Proto { typedef struct Proto {
TObject *k; /* constants used by the function */ TObject *k; /* constants used by the function */
int sizek; /* size of `k' */ int sizek; /* size of `k' */
struct Proto **kproto; /* functions defined inside the function */ struct Proto **p; /* functions defined inside the function */
int sizekproto; /* size of `kproto' */ int sizep; /* size of `p' */
Instruction *code; Instruction *code;
int sizecode; int sizecode;
short nupvalues; short nupvalues;

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lparser.c,v 1.149 2001/06/12 14:36:48 roberto Exp roberto $ ** $Id: lparser.c,v 1.150 2001/06/20 21:07:57 roberto Exp roberto $
** LL(1) Parser and code generator for Lua ** LL(1) Parser and code generator for Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -296,13 +296,13 @@ static void pushclosure (LexState *ls, FuncState *func, expdesc *v) {
int reg = fs->freereg; int reg = fs->freereg;
for (i=0; i<func->f->nupvalues; i++) for (i=0; i<func->f->nupvalues; i++)
luaK_exp2nextreg(fs, &func->upvalues[i]); luaK_exp2nextreg(fs, &func->upvalues[i]);
luaM_growvector(ls->L, f->kproto, fs->nkproto, f->sizekproto, Proto *, luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *,
MAXARG_Bc, l_s("constant table overflow")); MAXARG_Bc, l_s("constant table overflow"));
f->kproto[fs->nkproto++] = func->f; f->p[fs->np++] = func->f;
fs->freereg = reg; /* CLOSURE will consume those values */ fs->freereg = reg; /* CLOSURE will consume those values */
init_exp(v, VNONRELOC, reg); init_exp(v, VNONRELOC, reg);
luaK_reserveregs(fs, 1); luaK_reserveregs(fs, 1);
luaK_codeABc(fs, OP_CLOSURE, v->u.i.info, fs->nkproto-1); luaK_codeABc(fs, OP_CLOSURE, v->u.i.info, fs->np-1);
} }
@ -318,7 +318,7 @@ static void open_func (LexState *ls, FuncState *fs) {
fs->jlt = NO_JUMP; fs->jlt = NO_JUMP;
fs->freereg = 0; fs->freereg = 0;
fs->nk = 0; fs->nk = 0;
fs->nkproto = 0; fs->np = 0;
fs->nlineinfo = 0; fs->nlineinfo = 0;
fs->nlocvars = 0; fs->nlocvars = 0;
fs->nactloc = 0; fs->nactloc = 0;
@ -343,8 +343,8 @@ static void close_func (LexState *ls) {
f->sizecode = fs->pc; f->sizecode = fs->pc;
luaM_reallocvector(L, f->k, f->sizek, fs->nk, TObject); luaM_reallocvector(L, f->k, f->sizek, fs->nk, TObject);
f->sizek = fs->nk; f->sizek = fs->nk;
luaM_reallocvector(L, f->kproto, f->sizekproto, fs->nkproto, Proto *); luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *);
f->sizekproto = fs->nkproto; f->sizep = fs->np;
luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar);
f->sizelocvars = fs->nlocvars; f->sizelocvars = fs->nlocvars;
luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->nlineinfo+1, int); luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->nlineinfo+1, int);

View File

@ -1,5 +1,5 @@
/* /*
** $Id: lparser.h,v 1.30 2001/02/20 18:28:11 roberto Exp roberto $ ** $Id: lparser.h,v 1.31 2001/06/05 18:17:01 roberto Exp roberto $
** LL(1) Parser and code generator for Lua ** LL(1) Parser and code generator for Lua
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -53,7 +53,7 @@ typedef struct FuncState {
int jlt; /* list of jumps to `lasttarget' */ int jlt; /* list of jumps to `lasttarget' */
int freereg; /* first free register */ int freereg; /* first free register */
int nk; /* number of elements in `k' */ int nk; /* number of elements in `k' */
int nkproto; /* number of elements in `kproto' */ int np; /* number of elements in `p' */
int nlineinfo; /* number of elements in `lineinfo' */ int nlineinfo; /* number of elements in `lineinfo' */
int nlocvars; /* number of elements in `locvars' */ int nlocvars; /* number of elements in `locvars' */
int nactloc; /* number of active local variables */ int nactloc; /* number of active local variables */

4
lvm.c
View File

@ -1,5 +1,5 @@
/* /*
** $Id: lvm.c,v 1.188 2001/06/26 13:20:45 roberto Exp roberto $ ** $Id: lvm.c,v 1.189 2001/06/28 14:48:44 roberto Exp roberto $
** Lua virtual machine ** Lua virtual machine
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -644,7 +644,7 @@ StkId luaV_execute (lua_State *L, const Closure *cl, StkId base) {
break; break;
} }
case OP_CLOSURE: { case OP_CLOSURE: {
Proto *p = tf->kproto[GETARG_Bc(i)]; Proto *p = tf->p[GETARG_Bc(i)];
int nup = p->nupvalues; int nup = p->nupvalues;
luaV_checkGC(L, ra+nup); luaV_checkGC(L, ra+nup);
L->top = ra+nup; L->top = ra+nup;