diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-09-28 13:32:50 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-09-28 13:32:50 -0300 |
commit | 5938212748636d21d6f4b372481ab3b6dd6c7538 (patch) | |
tree | fa5d0a28dac1ff6c087585bc684534eb1ae82298 /lobject.h | |
parent | 1829911d7c1c16cf01dfdbfc8e7a26cfa10ec797 (diff) | |
download | lua-github-5938212748636d21d6f4b372481ab3b6dd6c7538.tar.gz |
information about upvalues (where they come from) kept in Proto structure,
instead of sequence of pseudo-opcodes after OP_CLOSURE
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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; |