aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Pall <mike>2011-06-12 23:51:13 +0200
committerMike Pall <mike>2011-06-12 23:51:13 +0200
commit9da94d135535c607d71a5d7e902b561ee418f0ca (patch)
tree2cb9e011046e4294650fb7e909b806fddc2f10c3 /lib
parent0c8696dfbf5a42a87a65f7b911ba2bc31a6a942c (diff)
downloadluajit-9da94d135535c607d71a5d7e902b561ee418f0ca.tar.gz
luajit-9da94d135535c607d71a5d7e902b561ee418f0ca.tar.bz2
luajit-9da94d135535c607d71a5d7e902b561ee418f0ca.zip
Add recursive dump option to jit.bc.dump().
Diffstat (limited to 'lib')
-rw-r--r--lib/bc.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/bc.lua b/lib/bc.lua
index 366617c8..f4ee8e8a 100644
--- a/lib/bc.lua
+++ b/lib/bc.lua
@@ -125,9 +125,16 @@ local function bctargets(func)
125end 125end
126 126
127-- Dump bytecode instructions of a function. 127-- Dump bytecode instructions of a function.
128local function bcdump(func, out) 128local function bcdump(func, out, all)
129 if not out then out = stdout end 129 if not out then out = stdout end
130 local fi = funcinfo(func) 130 local fi = funcinfo(func)
131 if all and fi.children then
132 for n=-1,-1000000000,-1 do
133 local k = funck(func, n)
134 if not k then break end
135 if type(k) == "proto" then bcdump(k, out, true) end
136 end
137 end
131 out:write(format("-- BYTECODE -- %s-%d\n", fi.loc, fi.lastlinedefined)) 138 out:write(format("-- BYTECODE -- %s-%d\n", fi.loc, fi.lastlinedefined))
132 local target = bctargets(func) 139 local target = bctargets(func)
133 for pc=1,1000000000 do 140 for pc=1,1000000000 do