aboutsummaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorMike Pall <mike>2024-04-19 00:12:22 +0200
committerMike Pall <mike>2024-04-19 00:12:22 +0200
commitd2fe2a6d465a3e4c74c9876db94ae606f9c6983b (patch)
treec66ac6119049a42936aca201bce795c02d4693f5 /src/jit
parentb8b49bf3954b23e32e34187a6ada00021c26e172 (diff)
downloadluajit-d2fe2a6d465a3e4c74c9876db94ae606f9c6983b.tar.gz
luajit-d2fe2a6d465a3e4c74c9876db94ae606f9c6983b.tar.bz2
luajit-d2fe2a6d465a3e4c74c9876db94ae606f9c6983b.zip
Show name of NYI bytecode in -jv and -jdump.
Suggested by Sergey Kaplun. #1176 #567
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/dump.lua7
-rw-r--r--src/jit/v.lua9
2 files changed, 13 insertions, 3 deletions
diff --git a/src/jit/dump.lua b/src/jit/dump.lua
index 746732f9..f296a517 100644
--- a/src/jit/dump.lua
+++ b/src/jit/dump.lua
@@ -552,7 +552,12 @@ local recdepth = 0
552local function fmterr(err, info) 552local function fmterr(err, info)
553 if type(err) == "number" then 553 if type(err) == "number" then
554 if type(info) == "function" then info = fmtfunc(info) end 554 if type(info) == "function" then info = fmtfunc(info) end
555 err = format(vmdef.traceerr[err], info) 555 local fmt = vmdef.traceerr[err]
556 if fmt == "NYI: bytecode %s" then
557 local oidx = 6 * info
558 info = sub(vmdef.bcnames, oidx+1, oidx+6)
559 end
560 err = format(fmt, info)
556 end 561 end
557 return err 562 return err
558end 563end
diff --git a/src/jit/v.lua b/src/jit/v.lua
index 8e91f494..45a663d7 100644
--- a/src/jit/v.lua
+++ b/src/jit/v.lua
@@ -62,7 +62,7 @@ local jit = require("jit")
62local jutil = require("jit.util") 62local jutil = require("jit.util")
63local vmdef = require("jit.vmdef") 63local vmdef = require("jit.vmdef")
64local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo 64local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo
65local type, format = type, string.format 65local type, sub, format = type, string.sub, string.format
66local stdout, stderr = io.stdout, io.stderr 66local stdout, stderr = io.stdout, io.stderr
67 67
68-- Active flag and output file handle. 68-- Active flag and output file handle.
@@ -89,7 +89,12 @@ end
89local function fmterr(err, info) 89local function fmterr(err, info)
90 if type(err) == "number" then 90 if type(err) == "number" then
91 if type(info) == "function" then info = fmtfunc(info) end 91 if type(info) == "function" then info = fmtfunc(info) end
92 err = format(vmdef.traceerr[err], info) 92 local fmt = vmdef.traceerr[err]
93 if fmt == "NYI: bytecode %s" then
94 local oidx = 6 * info
95 info = sub(vmdef.bcnames, oidx+1, oidx+6)
96 end
97 err = format(fmt, info)
93 end 98 end
94 return err 99 return err
95end 100end