From 45e533599f08d849951b49bcab0be4fd735a966d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 15 Dec 1997 14:17:20 -0200 Subject: optimization: closures without upvalues don't need to be closures --- lobject.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lobject.h') diff --git a/lobject.h b/lobject.h index 1be2b8f2..0f4d02fd 100644 --- a/lobject.h +++ b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 1.9 1997/11/19 17:29:23 roberto Exp roberto $ +** $Id: lobject.h,v 1.10 1997/11/27 18:25:06 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -42,9 +42,11 @@ typedef enum { LUA_T_PROTO = -4, /* fixed tag for functions */ LUA_T_CPROTO = -5, /* fixed tag for Cfunctions */ LUA_T_NIL = -6, /* last "pre-defined" tag */ - LUA_T_FUNCTION = -7, - LUA_T_MARK = -8, - LUA_T_LINE = -10 + LUA_T_CLOSURE = -7, + LUA_T_CLMARK = -8, /* mark for closures */ + LUA_T_PMARK = -9, /* mark for Lua prototypes */ + LUA_T_CMARK = -10, /* mark for C prototypes */ + LUA_T_LINE = -11 } lua_Type; #define NUM_TYPES 11 @@ -52,11 +54,11 @@ typedef enum { typedef union { - lua_CFunction f; /* LUA_T_CPROTO */ + lua_CFunction f; /* LUA_T_CPROTO, LUA_T_CMARK */ real n; /* LUA_T_NUMBER */ struct TaggedString *ts; /* LUA_T_STRING, LUA_T_USERDATA */ - struct TProtoFunc *tf; /* LUA_T_PROTO */ - struct Closure *cl; /* LUA_T_FUNCTION, LUA_T_MARK */ + struct TProtoFunc *tf; /* LUA_T_PROTO, LUA_T_PMARK */ + struct Closure *cl; /* LUA_T_CLOSURE, LUA_T_CLMARK */ struct Hash *a; /* LUA_T_ARRAY */ int i; /* LUA_T_LINE */ } Value; @@ -133,6 +135,7 @@ typedef struct LocVar { #define protovalue(o) ((o)->value.cl->consts) + /* ** Closures */ -- cgit v1.2.3-55-g6feb