From 5938212748636d21d6f4b372481ab3b6dd6c7538 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 28 Sep 2009 13:32:50 -0300 Subject: information about upvalues (where they come from) kept in Proto structure, instead of sequence of pseudo-opcodes after OP_CLOSURE --- lobject.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index 10eb363f..8b93f70a 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 2.27 2009/06/18 16:36:40 roberto Exp roberto $ +** $Id: lobject.h,v 2.28 2009/07/15 18:37:19 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -227,6 +227,15 @@ typedef union Udata { +/* +** Upvalues from a function prototype +*/ +typedef struct Upvaldesc { + TString *name; /* upvalue name (for debug information) */ + lu_byte instack; + lu_byte idx; /* index of upvalue (in stack or in outer function's list) */ +} Upvaldesc; + /* ** Function Prototypes @@ -238,9 +247,9 @@ typedef struct Proto { struct Proto **p; /* functions defined inside the function */ int *lineinfo; /* map from opcodes to source lines */ struct LocVar *locvars; /* information about local variables */ - TString **upvalues; /* upvalue names */ + Upvaldesc *upvalues; /* upvalue information */ TString *source; - int sizeupvalues; + int sizeupvalues; /* size of 'upvalues' */ int sizek; /* size of `k' */ int sizecode; int sizelineinfo; @@ -249,7 +258,6 @@ typedef struct Proto { int linedefined; int lastlinedefined; GCObject *gclist; - lu_byte nups; /* number of upvalues */ lu_byte numparams; lu_byte is_vararg; lu_byte maxstacksize; -- cgit v1.2.3-55-g6feb