diff options
-rw-r--r-- | lib/bc.lua | 9 | ||||
-rw-r--r-- | src/lib_jit.c | 2 |
2 files changed, 10 insertions, 1 deletions
@@ -125,9 +125,16 @@ local function bctargets(func) | |||
125 | end | 125 | end |
126 | 126 | ||
127 | -- Dump bytecode instructions of a function. | 127 | -- Dump bytecode instructions of a function. |
128 | local function bcdump(func, out) | 128 | local 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 |
diff --git a/src/lib_jit.c b/src/lib_jit.c index 31b27ccb..66b3856a 100644 --- a/src/lib_jit.c +++ b/src/lib_jit.c | |||
@@ -193,6 +193,8 @@ LJLIB_CF(jit_util_funcinfo) | |||
193 | setintfield(L, t, "currentline", lj_debug_line(pt, pc)); | 193 | setintfield(L, t, "currentline", lj_debug_line(pt, pc)); |
194 | lua_pushboolean(L, (pt->flags & PROTO_VARARG)); | 194 | lua_pushboolean(L, (pt->flags & PROTO_VARARG)); |
195 | lua_setfield(L, -2, "isvararg"); | 195 | lua_setfield(L, -2, "isvararg"); |
196 | lua_pushboolean(L, (pt->flags & PROTO_CHILD)); | ||
197 | lua_setfield(L, -2, "children"); | ||
196 | setstrV(L, L->top++, proto_chunkname(pt)); | 198 | setstrV(L, L->top++, proto_chunkname(pt)); |
197 | lua_setfield(L, -2, "source"); | 199 | lua_setfield(L, -2, "source"); |
198 | lj_debug_pushloc(L, pt, pc); | 200 | lj_debug_pushloc(L, pt, pc); |