mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Show name of NYI bytecode in -jv and -jdump.
Suggested by Sergey Kaplun. #1176 #567
This commit is contained in:
parent
b8b49bf395
commit
d2fe2a6d46
@ -552,7 +552,12 @@ local recdepth = 0
|
|||||||
local function fmterr(err, info)
|
local function fmterr(err, info)
|
||||||
if type(err) == "number" then
|
if type(err) == "number" then
|
||||||
if type(info) == "function" then info = fmtfunc(info) end
|
if type(info) == "function" then info = fmtfunc(info) end
|
||||||
err = format(vmdef.traceerr[err], info)
|
local fmt = vmdef.traceerr[err]
|
||||||
|
if fmt == "NYI: bytecode %s" then
|
||||||
|
local oidx = 6 * info
|
||||||
|
info = sub(vmdef.bcnames, oidx+1, oidx+6)
|
||||||
|
end
|
||||||
|
err = format(fmt, info)
|
||||||
end
|
end
|
||||||
return err
|
return err
|
||||||
end
|
end
|
||||||
|
@ -62,7 +62,7 @@ local jit = require("jit")
|
|||||||
local jutil = require("jit.util")
|
local jutil = require("jit.util")
|
||||||
local vmdef = require("jit.vmdef")
|
local vmdef = require("jit.vmdef")
|
||||||
local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo
|
local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo
|
||||||
local type, format = type, string.format
|
local type, sub, format = type, string.sub, string.format
|
||||||
local stdout, stderr = io.stdout, io.stderr
|
local stdout, stderr = io.stdout, io.stderr
|
||||||
|
|
||||||
-- Active flag and output file handle.
|
-- Active flag and output file handle.
|
||||||
@ -89,7 +89,12 @@ end
|
|||||||
local function fmterr(err, info)
|
local function fmterr(err, info)
|
||||||
if type(err) == "number" then
|
if type(err) == "number" then
|
||||||
if type(info) == "function" then info = fmtfunc(info) end
|
if type(info) == "function" then info = fmtfunc(info) end
|
||||||
err = format(vmdef.traceerr[err], info)
|
local fmt = vmdef.traceerr[err]
|
||||||
|
if fmt == "NYI: bytecode %s" then
|
||||||
|
local oidx = 6 * info
|
||||||
|
info = sub(vmdef.bcnames, oidx+1, oidx+6)
|
||||||
|
end
|
||||||
|
err = format(fmt, info)
|
||||||
end
|
end
|
||||||
return err
|
return err
|
||||||
end
|
end
|
||||||
|
@ -13,7 +13,7 @@ TREDEF(STACKOV, "trace too deep")
|
|||||||
TREDEF(SNAPOV, "too many snapshots")
|
TREDEF(SNAPOV, "too many snapshots")
|
||||||
TREDEF(BLACKL, "blacklisted")
|
TREDEF(BLACKL, "blacklisted")
|
||||||
TREDEF(RETRY, "retry recording")
|
TREDEF(RETRY, "retry recording")
|
||||||
TREDEF(NYIBC, "NYI: bytecode %d")
|
TREDEF(NYIBC, "NYI: bytecode %s")
|
||||||
|
|
||||||
/* Recording loop ops. */
|
/* Recording loop ops. */
|
||||||
TREDEF(LLEAVE, "leaving loop in root trace")
|
TREDEF(LLEAVE, "leaving loop in root trace")
|
||||||
|
Loading…
Reference in New Issue
Block a user