diff options
author | Mike Pall <mike> | 2014-12-20 00:59:16 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2014-12-20 01:48:00 +0100 |
commit | 5cb6e2eaaf860045daa30208b21ae6aa88a0503c (patch) | |
tree | b0b4c4edfc1a9a0c3f51efbd3c36580447eaa509 /src/lj_obj.h | |
parent | 6e9145a882ea70fe438d59959ac4e65481fe5e85 (diff) | |
download | luajit-5cb6e2eaaf860045daa30208b21ae6aa88a0503c.tar.gz luajit-5cb6e2eaaf860045daa30208b21ae6aa88a0503c.tar.bz2 luajit-5cb6e2eaaf860045daa30208b21ae6aa88a0503c.zip |
Cleanup of TValue setters. No functional changes.
Diffstat (limited to 'src/lj_obj.h')
-rw-r--r-- | src/lj_obj.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lj_obj.h b/src/lj_obj.h index 99e2d819..e5724859 100644 --- a/src/lj_obj.h +++ b/src/lj_obj.h | |||
@@ -43,12 +43,10 @@ typedef struct GCRef { | |||
43 | #define gcref(r) ((GCobj *)(uintptr_t)(r).gcptr32) | 43 | #define gcref(r) ((GCobj *)(uintptr_t)(r).gcptr32) |
44 | #define gcrefp(r, t) ((t *)(void *)(uintptr_t)(r).gcptr32) | 44 | #define gcrefp(r, t) ((t *)(void *)(uintptr_t)(r).gcptr32) |
45 | #define gcrefu(r) ((r).gcptr32) | 45 | #define gcrefu(r) ((r).gcptr32) |
46 | #define gcrefi(r) ((int32_t)(r).gcptr32) | ||
47 | #define gcrefeq(r1, r2) ((r1).gcptr32 == (r2).gcptr32) | 46 | #define gcrefeq(r1, r2) ((r1).gcptr32 == (r2).gcptr32) |
48 | #define gcnext(gc) (gcref((gc)->gch.nextgc)) | 47 | #define gcnext(gc) (gcref((gc)->gch.nextgc)) |
49 | 48 | ||
50 | #define setgcref(r, gc) ((r).gcptr32 = (uint32_t)(uintptr_t)&(gc)->gch) | 49 | #define setgcref(r, gc) ((r).gcptr32 = (uint32_t)(uintptr_t)&(gc)->gch) |
51 | #define setgcrefi(r, i) ((r).gcptr32 = (uint32_t)(i)) | ||
52 | #define setgcrefp(r, p) ((r).gcptr32 = (uint32_t)(uintptr_t)(p)) | 50 | #define setgcrefp(r, p) ((r).gcptr32 = (uint32_t)(uintptr_t)(p)) |
53 | #define setgcrefnull(r) ((r).gcptr32 = 0) | 51 | #define setgcrefnull(r) ((r).gcptr32 = 0) |
54 | #define setgcrefr(r, v) ((r).gcptr32 = (v).gcptr32) | 52 | #define setgcrefr(r, v) ((r).gcptr32 = (v).gcptr32) |
@@ -720,6 +718,7 @@ typedef union GCobj { | |||
720 | #define setitype(o, i) ((o)->it = (i)) | 718 | #define setitype(o, i) ((o)->it = (i)) |
721 | #define setnilV(o) ((o)->it = LJ_TNIL) | 719 | #define setnilV(o) ((o)->it = LJ_TNIL) |
722 | #define setboolV(o, x) ((o)->it = LJ_TFALSE-(uint32_t)(x)) | 720 | #define setboolV(o, x) ((o)->it = LJ_TFALSE-(uint32_t)(x)) |
721 | #define setpriV(o, i) (setitype((o), (i))) | ||
723 | 722 | ||
724 | static LJ_AINLINE void setlightudV(TValue *o, void *p) | 723 | static LJ_AINLINE void setlightudV(TValue *o, void *p) |
725 | { | 724 | { |
@@ -744,9 +743,14 @@ static LJ_AINLINE void setlightudV(TValue *o, void *p) | |||
744 | UNUSED(L), lua_assert(!tvisgcv(o) || \ | 743 | UNUSED(L), lua_assert(!tvisgcv(o) || \ |
745 | ((~itype(o) == gcval(o)->gch.gct) && !isdead(G(L), gcval(o)))) | 744 | ((~itype(o) == gcval(o)->gch.gct) && !isdead(G(L), gcval(o)))) |
746 | 745 | ||
747 | static LJ_AINLINE void setgcV(lua_State *L, TValue *o, GCobj *v, uint32_t itype) | 746 | static LJ_AINLINE void setgcVraw(TValue *o, GCobj *v, uint32_t itype) |
748 | { | 747 | { |
749 | setgcref(o->gcr, v); setitype(o, itype); tvchecklive(L, o); | 748 | setgcref(o->gcr, v); setitype(o, itype); |
749 | } | ||
750 | |||
751 | static LJ_AINLINE void setgcV(lua_State *L, TValue *o, GCobj *v, uint32_t it) | ||
752 | { | ||
753 | setgcVraw(o, v, it); tvchecklive(L, o); | ||
750 | } | 754 | } |
751 | 755 | ||
752 | #define define_setV(name, type, tag) \ | 756 | #define define_setV(name, type, tag) \ |