mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix exit state for 64 bit mode.
This commit is contained in:
parent
8ae2f9feaa
commit
857f538eac
29
lib/dump.lua
29
lib/dump.lua
@ -306,10 +306,18 @@ local function dump_snap(tr)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- NYI: should really get the register map from the disassembler.
|
-- NYI: should really get the register map from the disassembler.
|
||||||
local reg_map = {
|
local reg_map = ({
|
||||||
[0] = "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
|
x86 = {
|
||||||
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
|
[0] = "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
|
||||||
}
|
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
|
||||||
|
},
|
||||||
|
x64 = {
|
||||||
|
[0] = "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
|
||||||
|
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
|
||||||
|
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
|
||||||
|
"xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15",
|
||||||
|
}
|
||||||
|
})[jit.arch]
|
||||||
|
|
||||||
-- Return a register name or stack slot for a rid/sp location.
|
-- Return a register name or stack slot for a rid/sp location.
|
||||||
local function ridsp_name(ridsp)
|
local function ridsp_name(ridsp)
|
||||||
@ -508,9 +516,16 @@ local function dump_texit(tr, ex, ngpr, nfpr, ...)
|
|||||||
out:write("---- TRACE ", tr, " exit ", ex, "\n")
|
out:write("---- TRACE ", tr, " exit ", ex, "\n")
|
||||||
if dumpmode.X then
|
if dumpmode.X then
|
||||||
local regs = {...}
|
local regs = {...}
|
||||||
for i=1,ngpr do
|
if jit.arch == "x64" then
|
||||||
out:write(format(" %08x", regs[i]))
|
for i=1,ngpr do
|
||||||
if i % 8 == 0 then out:write("\n") end
|
out:write(format(" %016x", regs[i]))
|
||||||
|
if i % 4 == 0 then out:write("\n") end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
for i=1,ngpr do
|
||||||
|
out:write(format(" %08x", regs[i]))
|
||||||
|
if i % 8 == 0 then out:write("\n") end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for i=1,nfpr do
|
for i=1,nfpr do
|
||||||
out:write(format(" %+17.14g", regs[ngpr+i]))
|
out:write(format(" %+17.14g", regs[ngpr+i]))
|
||||||
|
@ -116,7 +116,7 @@ enum {
|
|||||||
/* This definition must match with the *.dasc file(s). */
|
/* This definition must match with the *.dasc file(s). */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */
|
lua_Number fpr[RID_NUM_FPR]; /* Floating-point registers. */
|
||||||
int32_t gpr[RID_NUM_GPR]; /* General-purpose registers. */
|
intptr_t gpr[RID_NUM_GPR]; /* General-purpose registers. */
|
||||||
int32_t spill[256]; /* Spill slots. */
|
int32_t spill[256]; /* Spill slots. */
|
||||||
} ExitState;
|
} ExitState;
|
||||||
|
|
||||||
|
@ -636,7 +636,7 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr)
|
|||||||
setintV(L->top++, RID_NUM_GPR);
|
setintV(L->top++, RID_NUM_GPR);
|
||||||
setintV(L->top++, RID_NUM_FPR);
|
setintV(L->top++, RID_NUM_FPR);
|
||||||
for (i = 0; i < RID_NUM_GPR; i++)
|
for (i = 0; i < RID_NUM_GPR; i++)
|
||||||
setintV(L->top++, ex->gpr[i]);
|
setnumV(L->top++, cast_num(ex->gpr[i]));
|
||||||
for (i = 0; i < RID_NUM_FPR; i++) {
|
for (i = 0; i < RID_NUM_FPR; i++) {
|
||||||
setnumV(L->top, ex->fpr[i]);
|
setnumV(L->top, ex->fpr[i]);
|
||||||
if (LJ_UNLIKELY(tvisnan(L->top)))
|
if (LJ_UNLIKELY(tvisnan(L->top)))
|
||||||
|
Loading…
Reference in New Issue
Block a user