mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Minor tweaks to integration of assembler part.
Remove unneeded PC restore in vm_growstack_*. Don't declare symbols that are unused in interpreter-only builds. Don't embed lj_vm_foldfpm in interpreter-only builds. Add 2nd temporary TValue in lua_State.
This commit is contained in:
parent
7313a0821d
commit
e1efd0d871
2212
src/buildvm_x64.h
2212
src/buildvm_x64.h
File diff suppressed because it is too large
Load Diff
1261
src/buildvm_x64win.h
1261
src/buildvm_x64win.h
File diff suppressed because it is too large
Load Diff
@ -574,11 +574,10 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
|
||||
| mov BASE, L:RB->base
|
||||
| mov RD, L:RB->top
|
||||
| mov LFUNC:RB, [BASE-8]
|
||||
| mov PC, [BASE-4]
|
||||
| sub RD, BASE
|
||||
| shr RD, 3
|
||||
| add NARGS:RD, 1
|
||||
| // BASE = new base, RB = LFUNC, RD = nargs+1, PC restored.
|
||||
| // BASE = new base, RB = LFUNC, RD = nargs+1
|
||||
| ins_callt // Just retry the call.
|
||||
|
|
||||
|//-----------------------------------------------------------------------
|
||||
@ -3079,6 +3078,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
|
||||
|// Callable from C: double lj_vm_foldfpm(double x, int fpm)
|
||||
|// Computes fpm(x) for extended math functions. ORDER FPM.
|
||||
|->vm_foldfpm:
|
||||
#if LJ_HASJIT
|
||||
if (sse) {
|
||||
|.if X64
|
||||
|
|
||||
@ -3174,6 +3174,7 @@ static void build_subroutines(BuildCtx *ctx, int cmov, int sse)
|
||||
|1: ; fptan; fpop; ret
|
||||
}
|
||||
|9: ; int3 // Bad fpm.
|
||||
#endif
|
||||
|
|
||||
|// Callable from C: double lj_vm_foldarith(double x, double y, int op)
|
||||
|// Compute x op y for basic arithmetic operators (+ - * / % ^ and unary -)
|
||||
|
1689
src/buildvm_x86.h
1689
src/buildvm_x86.h
File diff suppressed because it is too large
Load Diff
@ -480,7 +480,7 @@ typedef struct global_State {
|
||||
uint8_t vmevmask; /* VM event mask. */
|
||||
GCRef mainthref; /* Link to main thread. */
|
||||
TValue registrytv; /* Anchor for registry. */
|
||||
TValue tmptv; /* Temporary TValue. */
|
||||
TValue tmptv, tmptv2; /* Temporary TValues. */
|
||||
GCupval uvhead; /* Head of double-linked list of all open upvalues. */
|
||||
int32_t hookcount; /* Instruction hook countdown. */
|
||||
int32_t hookcstart; /* Start count for instruction hook counter. */
|
||||
|
11
src/lj_vm.h
11
src/lj_vm.h
@ -25,7 +25,9 @@ LJ_ASMF void lj_vm_unwind_ff_eh(void);
|
||||
LJ_ASMF int lj_vm_cpuid(uint32_t f, uint32_t res[4]);
|
||||
#endif
|
||||
LJ_ASMF double lj_vm_foldarith(double x, double y, int op);
|
||||
#if LJ_HASJIT
|
||||
LJ_ASMF double lj_vm_foldfpm(double x, int op);
|
||||
#endif
|
||||
|
||||
/* Dispatch targets for recording and hooks. */
|
||||
LJ_ASMF void lj_vm_record(void);
|
||||
@ -38,6 +40,8 @@ LJ_ASMF void lj_vm_exit_handler(void);
|
||||
LJ_ASMF void lj_vm_exit_interp(void);
|
||||
|
||||
/* Handlers callable from compiled code. */
|
||||
#if LJ_HASJIT
|
||||
#if LJ_TARGET_X86ORX64
|
||||
LJ_ASMF void lj_vm_floor_sse(void);
|
||||
LJ_ASMF void lj_vm_ceil_sse(void);
|
||||
LJ_ASMF void lj_vm_trunc_sse(void);
|
||||
@ -45,6 +49,13 @@ LJ_ASMF void lj_vm_exp(void);
|
||||
LJ_ASMF void lj_vm_exp2(void);
|
||||
LJ_ASMF void lj_vm_pow_sse(void);
|
||||
LJ_ASMF void lj_vm_powi_sse(void);
|
||||
#else
|
||||
LJ_ASMF void lj_vm_floor(void);
|
||||
LJ_ASMF void lj_vm_ceil(void);
|
||||
LJ_ASMF void lj_vm_trunc(void);
|
||||
LJ_ASMF void lj_vm_powi(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Continuations for metamethods. */
|
||||
LJ_ASMF void lj_cont_cat(void); /* Continue with concatenation. */
|
||||
|
Loading…
Reference in New Issue
Block a user