diff options
Diffstat (limited to 'src/jit')
| -rw-r--r-- | src/jit/dump.lua | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/jit/dump.lua b/src/jit/dump.lua index 5fb1e144..9eda08c4 100644 --- a/src/jit/dump.lua +++ b/src/jit/dump.lua | |||
| @@ -219,8 +219,10 @@ local function colorize_text(s) | |||
| 219 | return s | 219 | return s |
| 220 | end | 220 | end |
| 221 | 221 | ||
| 222 | local function colorize_ansi(s, t) | 222 | local function colorize_ansi(s, t, extra) |
| 223 | return format(colortype_ansi[t], s) | 223 | local out = format(colortype_ansi[t], s) |
| 224 | if extra then out = "\027[3m"..out end | ||
| 225 | return out | ||
| 224 | end | 226 | end |
| 225 | 227 | ||
| 226 | local irtype_ansi = setmetatable({}, | 228 | local irtype_ansi = setmetatable({}, |
| @@ -229,9 +231,10 @@ local irtype_ansi = setmetatable({}, | |||
| 229 | 231 | ||
| 230 | local html_escape = { ["<"] = "<", [">"] = ">", ["&"] = "&", } | 232 | local html_escape = { ["<"] = "<", [">"] = ">", ["&"] = "&", } |
| 231 | 233 | ||
| 232 | local function colorize_html(s, t) | 234 | local function colorize_html(s, t, extra) |
| 233 | s = gsub(s, "[<>&]", html_escape) | 235 | s = gsub(s, "[<>&]", html_escape) |
| 234 | return format('<span class="irt_%s">%s</span>', irtype_text[t], s) | 236 | return format('<span class="irt_%s%s">%s</span>', |
| 237 | irtype_text[t], extra and " irt_extra" or "", s) | ||
| 235 | end | 238 | end |
| 236 | 239 | ||
| 237 | local irtype_html = setmetatable({}, | 240 | local irtype_html = setmetatable({}, |
| @@ -256,6 +259,7 @@ span.irt_tab { color: #c00000; } | |||
| 256 | span.irt_udt, span.irt_lud { color: #00c0c0; } | 259 | span.irt_udt, span.irt_lud { color: #00c0c0; } |
| 257 | span.irt_num { color: #4040c0; } | 260 | span.irt_num { color: #4040c0; } |
| 258 | span.irt_int, span.irt_i8, span.irt_u8, span.irt_i16, span.irt_u16 { color: #b040b0; } | 261 | span.irt_int, span.irt_i8, span.irt_u8, span.irt_i16, span.irt_u16 { color: #b040b0; } |
| 262 | span.irt_extra { font-style: italic; } | ||
| 259 | </style> | 263 | </style> |
| 260 | ]] | 264 | ]] |
| 261 | 265 | ||
| @@ -271,6 +275,7 @@ local litname = { | |||
| 271 | if band(mode, 8) ~= 0 then s = s.."C" end | 275 | if band(mode, 8) ~= 0 then s = s.."C" end |
| 272 | if band(mode, 16) ~= 0 then s = s.."R" end | 276 | if band(mode, 16) ~= 0 then s = s.."R" end |
| 273 | if band(mode, 32) ~= 0 then s = s.."I" end | 277 | if band(mode, 32) ~= 0 then s = s.."I" end |
| 278 | if band(mode, 64) ~= 0 then s = s.."K" end | ||
| 274 | t[mode] = s | 279 | t[mode] = s |
| 275 | return s | 280 | return s |
| 276 | end}), | 281 | end}), |
| @@ -350,7 +355,7 @@ local function formatk(tr, idx, sn) | |||
| 350 | else | 355 | else |
| 351 | s = tostring(k) -- For primitives. | 356 | s = tostring(k) -- For primitives. |
| 352 | end | 357 | end |
| 353 | s = colorize(format("%-4s", s), t) | 358 | s = colorize(format("%-4s", s), t, band(sn or 0, 0x100000) ~= 0) |
| 354 | if slot then | 359 | if slot then |
| 355 | s = format("%s @%d", s, slot) | 360 | s = format("%s @%d", s, slot) |
| 356 | end | 361 | end |
| @@ -370,7 +375,7 @@ local function printsnap(tr, snap) | |||
| 370 | out:write(colorize(format("%04d/%04d", ref, ref+1), 14)) | 375 | out:write(colorize(format("%04d/%04d", ref, ref+1), 14)) |
| 371 | else | 376 | else |
| 372 | local m, ot, op1, op2 = traceir(tr, ref) | 377 | local m, ot, op1, op2 = traceir(tr, ref) |
| 373 | out:write(colorize(format("%04d", ref), band(ot, 31))) | 378 | out:write(colorize(format("%04d", ref), band(ot, 31), band(sn, 0x100000) ~= 0)) |
| 374 | end | 379 | end |
| 375 | out:write(band(sn, 0x10000) == 0 and " " or "|") -- SNAP_FRAME | 380 | out:write(band(sn, 0x10000) == 0 and " " or "|") -- SNAP_FRAME |
| 376 | else | 381 | else |
