summaryrefslogtreecommitdiff
path: root/lobject.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-15 14:17:20 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1997-12-15 14:17:20 -0200
commit45e533599f08d849951b49bcab0be4fd735a966d (patch)
treeb8e3b175989f694391dd3da4191894f5df1e7d75 /lobject.h
parent94144a7821c0fa412d5d228ab5197a8ebaaa3c25 (diff)
downloadlua-45e533599f08d849951b49bcab0be4fd735a966d.tar.gz
lua-45e533599f08d849951b49bcab0be4fd735a966d.tar.bz2
lua-45e533599f08d849951b49bcab0be4fd735a966d.zip
optimization: closures without upvalues don't need to be closures
Diffstat (limited to 'lobject.h')
-rw-r--r--lobject.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/lobject.h b/lobject.h
index 1be2b8f2..0f4d02fd 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 1.9 1997/11/19 17:29:23 roberto Exp roberto $ 2** $Id: lobject.h,v 1.10 1997/11/27 18:25:06 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*/
@@ -42,9 +42,11 @@ typedef enum {
42 LUA_T_PROTO = -4, /* fixed tag for functions */ 42 LUA_T_PROTO = -4, /* fixed tag for functions */
43 LUA_T_CPROTO = -5, /* fixed tag for Cfunctions */ 43 LUA_T_CPROTO = -5, /* fixed tag for Cfunctions */
44 LUA_T_NIL = -6, /* last "pre-defined" tag */ 44 LUA_T_NIL = -6, /* last "pre-defined" tag */
45 LUA_T_FUNCTION = -7, 45 LUA_T_CLOSURE = -7,
46 LUA_T_MARK = -8, 46 LUA_T_CLMARK = -8, /* mark for closures */
47 LUA_T_LINE = -10 47 LUA_T_PMARK = -9, /* mark for Lua prototypes */
48 LUA_T_CMARK = -10, /* mark for C prototypes */
49 LUA_T_LINE = -11
48} lua_Type; 50} lua_Type;
49 51
50#define NUM_TYPES 11 52#define NUM_TYPES 11
@@ -52,11 +54,11 @@ typedef enum {
52 54
53 55
54typedef union { 56typedef union {
55 lua_CFunction f; /* LUA_T_CPROTO */ 57 lua_CFunction f; /* LUA_T_CPROTO, LUA_T_CMARK */
56 real n; /* LUA_T_NUMBER */ 58 real n; /* LUA_T_NUMBER */
57 struct TaggedString *ts; /* LUA_T_STRING, LUA_T_USERDATA */ 59 struct TaggedString *ts; /* LUA_T_STRING, LUA_T_USERDATA */
58 struct TProtoFunc *tf; /* LUA_T_PROTO */ 60 struct TProtoFunc *tf; /* LUA_T_PROTO, LUA_T_PMARK */
59 struct Closure *cl; /* LUA_T_FUNCTION, LUA_T_MARK */ 61 struct Closure *cl; /* LUA_T_CLOSURE, LUA_T_CLMARK */
60 struct Hash *a; /* LUA_T_ARRAY */ 62 struct Hash *a; /* LUA_T_ARRAY */
61 int i; /* LUA_T_LINE */ 63 int i; /* LUA_T_LINE */
62} Value; 64} Value;
@@ -133,6 +135,7 @@ typedef struct LocVar {
133 135
134#define protovalue(o) ((o)->value.cl->consts) 136#define protovalue(o) ((o)->value.cl->consts)
135 137
138
136/* 139/*
137** Closures 140** Closures
138*/ 141*/