diff options
| author | Mike Pall <mike> | 2024-04-19 00:12:22 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2024-04-19 00:12:22 +0200 |
| commit | d2fe2a6d465a3e4c74c9876db94ae606f9c6983b (patch) | |
| tree | c66ac6119049a42936aca201bce795c02d4693f5 /src | |
| parent | b8b49bf3954b23e32e34187a6ada00021c26e172 (diff) | |
| download | luajit-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')
| -rw-r--r-- | src/jit/dump.lua | 7 | ||||
| -rw-r--r-- | src/jit/v.lua | 9 | ||||
| -rw-r--r-- | src/lj_traceerr.h | 2 |
3 files changed, 14 insertions, 4 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 | |||
| 552 | local function fmterr(err, info) | 552 | local 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 |
| 558 | end | 563 | end |
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") | |||
| 62 | local jutil = require("jit.util") | 62 | local jutil = require("jit.util") |
| 63 | local vmdef = require("jit.vmdef") | 63 | local vmdef = require("jit.vmdef") |
| 64 | local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo | 64 | local funcinfo, traceinfo = jutil.funcinfo, jutil.traceinfo |
| 65 | local type, format = type, string.format | 65 | local type, sub, format = type, string.sub, string.format |
| 66 | local stdout, stderr = io.stdout, io.stderr | 66 | local 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 | |||
| 89 | local function fmterr(err, info) | 89 | local 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 |
| 95 | end | 100 | end |
diff --git a/src/lj_traceerr.h b/src/lj_traceerr.h index 19ce30ad..08134dc5 100644 --- a/src/lj_traceerr.h +++ b/src/lj_traceerr.h | |||
| @@ -13,7 +13,7 @@ TREDEF(STACKOV, "trace too deep") | |||
| 13 | TREDEF(SNAPOV, "too many snapshots") | 13 | TREDEF(SNAPOV, "too many snapshots") |
| 14 | TREDEF(BLACKL, "blacklisted") | 14 | TREDEF(BLACKL, "blacklisted") |
| 15 | TREDEF(RETRY, "retry recording") | 15 | TREDEF(RETRY, "retry recording") |
| 16 | TREDEF(NYIBC, "NYI: bytecode %d") | 16 | TREDEF(NYIBC, "NYI: bytecode %s") |
| 17 | 17 | ||
| 18 | /* Recording loop ops. */ | 18 | /* Recording loop ops. */ |
| 19 | TREDEF(LLEAVE, "leaving loop in root trace") | 19 | TREDEF(LLEAVE, "leaving loop in root trace") |
