diff options
Diffstat (limited to 'src/lj_obj.h')
-rw-r--r-- | src/lj_obj.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/lj_obj.h b/src/lj_obj.h index cc999aa4..daa62e34 100644 --- a/src/lj_obj.h +++ b/src/lj_obj.h | |||
@@ -119,11 +119,12 @@ typedef int32_t BCLine; /* Bytecode line number. */ | |||
119 | /* Internal assembler functions. Never call these directly from C. */ | 119 | /* Internal assembler functions. Never call these directly from C. */ |
120 | typedef void (*ASMFunction)(void); | 120 | typedef void (*ASMFunction)(void); |
121 | 121 | ||
122 | /* Resizable string buffer. Need this here, details in lj_str.h. */ | 122 | /* Resizable string buffer. Need this here, details in lj_buf.h. */ |
123 | typedef struct SBuf { | 123 | typedef struct SBuf { |
124 | char *buf; /* String buffer base. */ | 124 | MRef p; /* String buffer pointer. */ |
125 | MSize n; /* String buffer length. */ | 125 | MRef e; /* String buffer end pointer. */ |
126 | MSize sz; /* String buffer size. */ | 126 | MRef b; /* String buffer base. */ |
127 | MRef L; /* lua_State, used for buffer resizing. */ | ||
127 | } SBuf; | 128 | } SBuf; |
128 | 129 | ||
129 | /* -- Tags and values ----------------------------------------------------- */ | 130 | /* -- Tags and values ----------------------------------------------------- */ |
@@ -516,8 +517,8 @@ typedef struct global_State { | |||
516 | lua_Alloc allocf; /* Memory allocator. */ | 517 | lua_Alloc allocf; /* Memory allocator. */ |
517 | void *allocd; /* Memory allocator data. */ | 518 | void *allocd; /* Memory allocator data. */ |
518 | GCState gc; /* Garbage collector. */ | 519 | GCState gc; /* Garbage collector. */ |
519 | SBuf tmpbuf; /* Temporary buffer for string concatenation. */ | 520 | volatile int32_t vmstate; /* VM state or current JIT code trace number. */ |
520 | Node nilnode; /* Fallback 1-element hash part (nil key and value). */ | 521 | SBuf tmpbuf; /* Temporary string buffer. */ |
521 | GCstr strempty; /* Empty string. */ | 522 | GCstr strempty; /* Empty string. */ |
522 | uint8_t stremptyz; /* Zero terminator of empty string. */ | 523 | uint8_t stremptyz; /* Zero terminator of empty string. */ |
523 | uint8_t hookmask; /* Hook mask. */ | 524 | uint8_t hookmask; /* Hook mask. */ |
@@ -526,17 +527,17 @@ typedef struct global_State { | |||
526 | GCRef mainthref; /* Link to main thread. */ | 527 | GCRef mainthref; /* Link to main thread. */ |
527 | TValue registrytv; /* Anchor for registry. */ | 528 | TValue registrytv; /* Anchor for registry. */ |
528 | TValue tmptv, tmptv2; /* Temporary TValues. */ | 529 | TValue tmptv, tmptv2; /* Temporary TValues. */ |
530 | Node nilnode; /* Fallback 1-element hash part (nil key and value). */ | ||
529 | GCupval uvhead; /* Head of double-linked list of all open upvalues. */ | 531 | GCupval uvhead; /* Head of double-linked list of all open upvalues. */ |
530 | int32_t hookcount; /* Instruction hook countdown. */ | 532 | int32_t hookcount; /* Instruction hook countdown. */ |
531 | int32_t hookcstart; /* Start count for instruction hook counter. */ | 533 | int32_t hookcstart; /* Start count for instruction hook counter. */ |
532 | lua_Hook hookf; /* Hook function. */ | 534 | lua_Hook hookf; /* Hook function. */ |
533 | lua_CFunction wrapf; /* Wrapper for C function calls. */ | 535 | lua_CFunction wrapf; /* Wrapper for C function calls. */ |
534 | lua_CFunction panic; /* Called as a last resort for errors. */ | 536 | lua_CFunction panic; /* Called as a last resort for errors. */ |
535 | volatile int32_t vmstate; /* VM state or current JIT code trace number. */ | ||
536 | BCIns bc_cfunc_int; /* Bytecode for internal C function calls. */ | 537 | BCIns bc_cfunc_int; /* Bytecode for internal C function calls. */ |
537 | BCIns bc_cfunc_ext; /* Bytecode for external C function calls. */ | 538 | BCIns bc_cfunc_ext; /* Bytecode for external C function calls. */ |
538 | GCRef jit_L; /* Current JIT code lua_State or NULL. */ | 539 | GCRef cur_L; /* Currently executing lua_State. */ |
539 | MRef jit_base; /* Current JIT code L->base. */ | 540 | MRef jit_base; /* Current JIT code L->base or NULL. */ |
540 | MRef ctype_state; /* Pointer to C type state. */ | 541 | MRef ctype_state; /* Pointer to C type state. */ |
541 | GCRef gcroot[GCROOT_MAX]; /* GC roots. */ | 542 | GCRef gcroot[GCROOT_MAX]; /* GC roots. */ |
542 | } global_State; | 543 | } global_State; |
@@ -553,6 +554,7 @@ typedef struct global_State { | |||
553 | #define HOOK_ACTIVE_SHIFT 4 | 554 | #define HOOK_ACTIVE_SHIFT 4 |
554 | #define HOOK_VMEVENT 0x20 | 555 | #define HOOK_VMEVENT 0x20 |
555 | #define HOOK_GC 0x40 | 556 | #define HOOK_GC 0x40 |
557 | #define HOOK_PROFILE 0x80 | ||
556 | #define hook_active(g) ((g)->hookmask & HOOK_ACTIVE) | 558 | #define hook_active(g) ((g)->hookmask & HOOK_ACTIVE) |
557 | #define hook_enter(g) ((g)->hookmask |= HOOK_ACTIVE) | 559 | #define hook_enter(g) ((g)->hookmask |= HOOK_ACTIVE) |
558 | #define hook_entergc(g) ((g)->hookmask |= (HOOK_ACTIVE|HOOK_GC)) | 560 | #define hook_entergc(g) ((g)->hookmask |= (HOOK_ACTIVE|HOOK_GC)) |
@@ -810,11 +812,7 @@ static LJ_AINLINE int32_t lj_num2bit(lua_Number n) | |||
810 | #endif | 812 | #endif |
811 | } | 813 | } |
812 | 814 | ||
813 | #if LJ_TARGET_X86 && !defined(__SSE2__) | ||
814 | #define lj_num2int(n) lj_num2bit((n)) | ||
815 | #else | ||
816 | #define lj_num2int(n) ((int32_t)(n)) | 815 | #define lj_num2int(n) ((int32_t)(n)) |
817 | #endif | ||
818 | 816 | ||
819 | static LJ_AINLINE uint64_t lj_num2u64(lua_Number n) | 817 | static LJ_AINLINE uint64_t lj_num2u64(lua_Number n) |
820 | { | 818 | { |
@@ -851,6 +849,7 @@ LJ_DATA const char *const lj_obj_itypename[~LJ_TNUMX+1]; | |||
851 | #define lj_typename(o) (lj_obj_itypename[itypemap(o)]) | 849 | #define lj_typename(o) (lj_obj_itypename[itypemap(o)]) |
852 | 850 | ||
853 | /* Compare two objects without calling metamethods. */ | 851 | /* Compare two objects without calling metamethods. */ |
854 | LJ_FUNC int lj_obj_equal(cTValue *o1, cTValue *o2); | 852 | LJ_FUNC int LJ_FASTCALL lj_obj_equal(cTValue *o1, cTValue *o2); |
853 | LJ_FUNC const void * LJ_FASTCALL lj_obj_ptr(cTValue *o); | ||
855 | 854 | ||
856 | #endif | 855 | #endif |