local function fmterr(err, info)
if type(err) == "number" then
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
return err
end
local jutil = require("jit.util")
local vmdef = require("jit.vmdef")
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
-- Active flag and output file handle.
local function fmterr(err, info)
if type(err) == "number" then
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
return err
end
TREDEF(SNAPOV, "too many snapshots")
TREDEF(BLACKL, "blacklisted")
TREDEF(RETRY, "retry recording")
-TREDEF(NYIBC, "NYI: bytecode %d")
+TREDEF(NYIBC, "NYI: bytecode %s")
/* Recording loop ops. */
TREDEF(LLEAVE, "leaving loop in root trace")