diff options
author | Mike Pall <mike> | 2010-02-05 00:52:21 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-02-05 00:52:21 +0100 |
commit | d7789821208336a7fe6e0b6d706b6b4844e6fa9e (patch) | |
tree | f6b3c28815c0dec1164ec851d10f76cf8cb62102 /src/lj_obj.h | |
parent | c8d55e850624bc237532fd103d1591b64d291081 (diff) | |
download | luajit-d7789821208336a7fe6e0b6d706b6b4844e6fa9e.tar.gz luajit-d7789821208336a7fe6e0b6d706b6b4844e6fa9e.tar.bz2 luajit-d7789821208336a7fe6e0b6d706b6b4844e6fa9e.zip |
32/64 bit memory ref cleanup, part 2: GCproto ->uvname and ->chunkname.
Diffstat (limited to 'src/lj_obj.h')
-rw-r--r-- | src/lj_obj.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lj_obj.h b/src/lj_obj.h index 22b69c60..164ec853 100644 --- a/src/lj_obj.h +++ b/src/lj_obj.h | |||
@@ -352,7 +352,7 @@ typedef struct GCproto { | |||
352 | GCRef gclist; | 352 | GCRef gclist; |
353 | MRef k; /* Split constant array (points to the middle). */ | 353 | MRef k; /* Split constant array (points to the middle). */ |
354 | MRef bc; /* Array of bytecode instructions. */ | 354 | MRef bc; /* Array of bytecode instructions. */ |
355 | uint16_t *uv; /* Upvalue list. local slot|0x8000 or parent uv idx. */ | 355 | MRef uv; /* Upvalue list. local slot|0x8000 or parent uv idx. */ |
356 | MSize sizekgc; /* Number of collectable constants. */ | 356 | MSize sizekgc; /* Number of collectable constants. */ |
357 | MSize sizekn; /* Number of lua_Number constants. */ | 357 | MSize sizekn; /* Number of lua_Number constants. */ |
358 | uint8_t sizeuv; /* Number of upvalues. */ | 358 | uint8_t sizeuv; /* Number of upvalues. */ |
@@ -366,8 +366,8 @@ typedef struct GCproto { | |||
366 | BCLine lastlinedefined; /* Last line of the function definition. */ | 366 | BCLine lastlinedefined; /* Last line of the function definition. */ |
367 | BCLine *lineinfo; /* Map from bytecode instructions to source lines. */ | 367 | BCLine *lineinfo; /* Map from bytecode instructions to source lines. */ |
368 | struct VarInfo *varinfo; /* Names and extents of local variables. */ | 368 | struct VarInfo *varinfo; /* Names and extents of local variables. */ |
369 | GCstr **uvname; /* Upvalue names. */ | 369 | MRef uvname; /* Array of upvalue names (GCRef of GCstr). */ |
370 | GCstr *chunkname; /* Name of the chunk this function was defined in. */ | 370 | GCRef chunkname; /* Name of the chunk this function was defined in. */ |
371 | } GCproto; | 371 | } GCproto; |
372 | 372 | ||
373 | #define PROTO_IS_VARARG 0x01 | 373 | #define PROTO_IS_VARARG 0x01 |
@@ -388,6 +388,11 @@ typedef struct GCproto { | |||
388 | #define proto_insptr(pt, pos) \ | 388 | #define proto_insptr(pt, pos) \ |
389 | check_exp((uintptr_t)(pos) < (pt)->sizebc, &proto_bc(pt)[(pos)]) | 389 | check_exp((uintptr_t)(pos) < (pt)->sizebc, &proto_bc(pt)[(pos)]) |
390 | #define proto_bcpos(pt, pc) ((BCPos)((pc) - proto_bc(pt))) | 390 | #define proto_bcpos(pt, pc) ((BCPos)((pc) - proto_bc(pt))) |
391 | #define proto_uv(pt) (mref((pt)->uv, uint16_t)) | ||
392 | #define proto_uvname(pt, idx) \ | ||
393 | check_exp((uintptr_t)(idx) < (pt)->sizeuvname, \ | ||
394 | gcref(mref((pt)->uvname, GCRef)[(idx)])) | ||
395 | #define proto_chunkname(pt) (gco2str(gcref((pt)->chunkname))) | ||
391 | 396 | ||
392 | /* -- Upvalue object ------------------------------------------------------ */ | 397 | /* -- Upvalue object ------------------------------------------------------ */ |
393 | 398 | ||