aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2016-11-13 20:03:01 +0100
committerMike Pall <mike>2016-11-13 20:03:01 +0100
commit7a58a8fb3d3d5808c54d096ab772113bf9024ae8 (patch)
tree32cfdefc8c9bb682078fa76acdcb1751a5e9dec9
parent716f2daef8019ce53d75d2c376c74b8f478fd5c5 (diff)
downloadluajit-7a58a8fb3d3d5808c54d096ab772113bf9024ae8.tar.gz
luajit-7a58a8fb3d3d5808c54d096ab772113bf9024ae8.tar.bz2
luajit-7a58a8fb3d3d5808c54d096ab772113bf9024ae8.zip
Report parent of stitched trace.
Thanks to Nick Zavaritsky.
-rw-r--r--src/jit/dump.lua2
-rw-r--r--src/jit/v.lua2
-rw-r--r--src/lj_trace.c6
3 files changed, 8 insertions, 2 deletions
diff --git a/src/jit/dump.lua b/src/jit/dump.lua
index a8bc2af2..1adf7095 100644
--- a/src/jit/dump.lua
+++ b/src/jit/dump.lua
@@ -556,7 +556,7 @@ local function dump_trace(what, tr, func, pc, otr, oex)
556 if what == "start" then 556 if what == "start" then
557 if dumpmode.H then out:write('<pre class="ljdump">\n') end 557 if dumpmode.H then out:write('<pre class="ljdump">\n') end
558 out:write("---- TRACE ", tr, " ", what) 558 out:write("---- TRACE ", tr, " ", what)
559 if otr then out:write(" ", otr, "/", oex) end 559 if otr then out:write(" ", otr, "/", oex == -1 and "stitch" or oex) end
560 out:write(" ", fmtfunc(func, pc), "\n") 560 out:write(" ", fmtfunc(func, pc), "\n")
561 elseif what == "stop" or what == "abort" then 561 elseif what == "stop" or what == "abort" then
562 out:write("---- TRACE ", tr, " ", what) 562 out:write("---- TRACE ", tr, " ", what)
diff --git a/src/jit/v.lua b/src/jit/v.lua
index 60c8b05a..b07ec7c0 100644
--- a/src/jit/v.lua
+++ b/src/jit/v.lua
@@ -99,7 +99,7 @@ end
99local function dump_trace(what, tr, func, pc, otr, oex) 99local function dump_trace(what, tr, func, pc, otr, oex)
100 if what == "start" then 100 if what == "start" then
101 startloc = fmtfunc(func, pc) 101 startloc = fmtfunc(func, pc)
102 startex = otr and "("..otr.."/"..oex..") " or "" 102 startex = otr and "("..otr.."/"..(oex == -1 and "stitch" or oex)..") " or ""
103 else 103 else
104 if what == "abort" then 104 if what == "abort" then
105 local loc = fmtfunc(func, pc) 105 local loc = fmtfunc(func, pc)
diff --git a/src/lj_trace.c b/src/lj_trace.c
index 87146832..11e54d97 100644
--- a/src/lj_trace.c
+++ b/src/lj_trace.c
@@ -446,6 +446,12 @@ static void trace_start(jit_State *J)
446 if (J->parent) { 446 if (J->parent) {
447 setintV(L->top++, J->parent); 447 setintV(L->top++, J->parent);
448 setintV(L->top++, J->exitno); 448 setintV(L->top++, J->exitno);
449 } else {
450 BCOp op = bc_op(*J->pc);
451 if (op == BC_CALLM || op == BC_CALL || op == BC_ITERC) {
452 setintV(L->top++, J->exitno); /* Parent of stitched trace. */
453 setintV(L->top++, -1);
454 }
449 } 455 }
450 ); 456 );
451 lj_record_setup(J); 457 lj_record_setup(J);