diff options
Diffstat (limited to 'src/lj_obj.h')
-rw-r--r-- | src/lj_obj.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/lj_obj.h b/src/lj_obj.h index b967819d..5a05f38d 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,13 +527,13 @@ 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 jit_L; /* Current JIT code lua_State or NULL. */ |
@@ -810,11 +811,7 @@ static LJ_AINLINE int32_t lj_num2bit(lua_Number n) | |||
810 | #endif | 811 | #endif |
811 | } | 812 | } |
812 | 813 | ||
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)) | 814 | #define lj_num2int(n) ((int32_t)(n)) |
817 | #endif | ||
818 | 815 | ||
819 | static LJ_AINLINE uint64_t lj_num2u64(lua_Number n) | 816 | static LJ_AINLINE uint64_t lj_num2u64(lua_Number n) |
820 | { | 817 | { |
@@ -851,6 +848,7 @@ LJ_DATA const char *const lj_obj_itypename[~LJ_TNUMX+1]; | |||
851 | #define lj_typename(o) (lj_obj_itypename[itypemap(o)]) | 848 | #define lj_typename(o) (lj_obj_itypename[itypemap(o)]) |
852 | 849 | ||
853 | /* Compare two objects without calling metamethods. */ | 850 | /* Compare two objects without calling metamethods. */ |
854 | LJ_FUNC int lj_obj_equal(cTValue *o1, cTValue *o2); | 851 | LJ_FUNC int LJ_FASTCALL lj_obj_equal(cTValue *o1, cTValue *o2); |
852 | LJ_FUNC const void * LJ_FASTCALL lj_obj_ptr(cTValue *o); | ||
855 | 853 | ||
856 | #endif | 854 | #endif |