Skip to content

Instantly share code, notes, and snippets.

@ExtReMLapin
Created March 22, 2020 20:36
Show Gist options
  • Save ExtReMLapin/1c6952e9a94f0d3f9aded05459e67ee6 to your computer and use it in GitHub Desktop.
Save ExtReMLapin/1c6952e9a94f0d3f9aded05459e67ee6 to your computer and use it in GitHub Desktop.
[TRACE FAIL --- @lua/includes/util.lua:178 -- NYI: bytecode FNEW at @lua/includes/util.lua:182]
[TRACE FAIL --- @lua/includes/util.lua:178 -- NYI: bytecode FNEW at @lua/includes/util.lua:182]
[TRACE FAIL --- @lua/includes/extensions/client/panel/scriptedpanels.lua:71 -- NYI: bytecode FNEW at @lua/includes/extensions/client/panel/scriptedpanels.lua:89]
[TRACE FAIL --- (4/0) @lua/includes/modules/list.lua:30 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/colour.lua:131]
[TRACE FAIL --- (5/0) @lua/includes/modules/list.lua:40 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/dynamite.lua:178]
[TRACE FAIL --- (5/0) @lua/includes/modules/list.lua:40 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/hoverball.lua:220]
[TRACE FAIL --- (5/0) @lua/includes/modules/list.lua:40 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/lamp.lua:280]
[TRACE FAIL --- (5/0) @lua/includes/modules/list.lua:40 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/physprop.lua:63]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
[TRACE FAIL --- @lua/includes/modules/weapons.lua:131 -- NYI: bytecode ISNEXT at @lua/includes/modules/weapons.lua:138]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
[TRACE FAIL --- @lua/includes/modules/scripted_ents.lua:153 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:164]
[TRACE FAIL --- @lua/includes/modules/scripted_ents.lua:153 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:164]
[TRACE FAIL --- @lua/includes/modules/scripted_ents.lua:22 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:24]
[TRACE FAIL --- @lua/includes/extensions/table.lua:81 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:83]
[TRACE FAIL --- @lua/includes/extensions/table.lua:81 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:83]
[TRACE FAIL --- @lua/derma/derma_menus.lua:10 -- NYI: bytecode ISNEXT at @lua/derma/derma_menus.lua:22]
[TRACE FAIL --- @lua/includes/extensions/table.lua:81 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:83]
[TRACE FAIL --- @lua/includes/extensions/table.lua:81 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:83]
[TRACE FAIL --- @lua/includes/util/color.lua:14 -- leaving loop in root trace at @lua/vgui/dcategorycollapse.lua:25]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/controlpanel.lua:119 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:418]
[TRACE FAIL --- (58/1) @lua/includes/util.lua:205 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (58/1) @lua/includes/util.lua:205 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (58/1) @lua/includes/util.lua:205 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (58/1) @lua/includes/util.lua:205 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- @lua/includes/util/vgui_showlayout.lua:12 -- NYI: bytecode ISNEXT at @lua/includes/util/vgui_showlayout.lua:15]
[TRACE FAIL --- @lua/includes/util/vgui_showlayout.lua:12 -- NYI: bytecode ISNEXT at @lua/includes/util/vgui_showlayout.lua:15]
[TRACE FAIL --- @lua/includes/extensions/table.lua:81 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:83]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:130 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:132]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:130 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:132]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:130 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:132]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:130 -- leaving loop in root trace at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:158]
[TRACE FAIL --- (78/1) @lua/includes/extensions/table.lua:487 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:158]
[TRACE FAIL --- (78/1) @lua/includes/extensions/table.lua:487 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:158]
[TRACE FAIL --- (78/1) @lua/includes/extensions/table.lua:487 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:158]
[TRACE FAIL --- (78/1) @lua/includes/extensions/table.lua:487 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:158]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:130 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:132]
[TRACE FAIL --- @lua/includes/util/color.lua:14 -- leaving loop in root trace at @lua/vgui/dimage.lua:12]
[TRACE FAIL --- @lua/includes/extensions/table.lua:156 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:158]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:130 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:132]
[TRACE FAIL --- @lua/vgui/spawnicon.lua:193 -- call unroll limit reached at @lua/includes/extensions/client/panel/scriptedpanels.lua:19]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:145 -- NYI: bytecode UCLO at @lua/includes/modules/spawnmenu.lua:237]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:145 -- NYI: bytecode UCLO at @lua/includes/modules/spawnmenu.lua:237]
[TRACE FAIL --- @lua/includes/extensions/table.lua:81 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:83]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contenttypes/custom.lua:145 -- NYI: bytecode UCLO at @lua/includes/modules/spawnmenu.lua:237]
[TRACE FAIL --- @lua/vgui/spawnicon.lua:193 -- call unroll limit reached at @lua/includes/extensions/client/panel/scriptedpanels.lua:19]
[TRACE FAIL --- @lua/includes/modules/spawnmenu.lua:228 -- NYI: bytecode UCLO at @lua/includes/modules/spawnmenu.lua:237]
[TRACE FAIL --- @lua/includes/util/color.lua:14 -- leaving loop in root trace at @gamemodes/sandbox/gamemode/spawnmenu/creationmenu/content/contentheader.lua:14]
[TRACE FAIL --- (115/stitch) @lua/includes/extensions/client/panel.lua:460 -- call unroll limit reached at @lua/includes/extensions/client/panel/scriptedpanels.lua:19]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
[TRACE FAIL --- @lua/includes/util/workshop_files.lua:7 -- NYI: bytecode FNEW at @lua/includes/util/workshop_files.lua:45]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
[TRACE FAIL --- @lua/includes/extensions/client/player.lua:65 -- NYI: bytecode ISNEXT at @lua/includes/extensions/client/player.lua:67]
[TRACE FAIL --- @lua/includes/modules/notification.lua:139 -- NYI: bytecode ISNEXT at @lua/includes/modules/notification.lua:144]
[TRACE FAIL --- @lua/includes/util/vgui_showlayout.lua:12 -- NYI: bytecode ISNEXT at @lua/includes/util/vgui_showlayout.lua:15]
[TRACE FAIL --- @lua/includes/extensions/math.lua:39 -- leaving loop in root trace at @lua/includes/util/client.lua:14]
[TRACE FAIL --- (216/stitch) @lua/includes/modules/hook.lua:58 -- NYI: bytecode VARG]
[TRACE FAIL --- (222/stitch) @lua/postprocess/frame_blend.lua:179 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (232/stitch) @lua/postprocess/texturize.lua:23 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (243/stitch) @lua/postprocess/sobel.lua:22 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (256/stitch) @gamemodes/base/gamemode/cl_deathnotice.lua:185 -- NYI: bytecode ISNEXT at @gamemodes/base/gamemode/cl_deathnotice.lua:188]
[TRACE FAIL --- (264/stitch) @lua/includes/modules/widget.lua:96 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- @lua/includes/util/vgui_showlayout.lua:12 -- NYI: bytecode ISNEXT at @lua/includes/util/vgui_showlayout.lua:15]
[TRACE FAIL --- (284/stitch) @lua/postprocess/sunbeams.lua:33 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (302/stitch) @lua/includes/modules/hook.lua:58 -- NYI: bytecode VARG]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/cl_search_models.lua:33 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/cl_search_models.lua:34]
[TRACE FAIL --- (305/stitch) @lua/postprocess/color_modify.lua:36 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (309/stitch) @lua/postprocess/overlay.lua:35 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (311/stitch) @gamemodes/base/gamemode/cl_hudpickup.lua:98 -- NYI: bytecode ISNEXT at @gamemodes/base/gamemode/cl_hudpickup.lua:102]
[TRACE FAIL --- (313/stitch) @lua/postprocess/bloom.lua:69 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (316/stitch) @lua/postprocess/bokeh_dof.lua:49 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- @lua/includes/extensions/math.lua:39 -- leaving loop in root trace at @lua/includes/util/client.lua:14]
[TRACE FAIL --- @lua/includes/extensions/client/player.lua:65 -- NYI: bytecode ISNEXT at @lua/includes/extensions/client/player.lua:67]
[TRACE FAIL --- @gamemodes/base/gamemode/cl_init.lua:714 -- error thrown or hook called during recording at @gamemodes/base/gamemode/cl_init.lua:715]
[TRACE FAIL --- @lua/includes/util/vgui_showlayout.lua:12 -- NYI: bytecode ISNEXT at @lua/includes/util/vgui_showlayout.lua:15]
[TRACE FAIL --- (329/stitch) @lua/postprocess/motion_blur.lua:65 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (330/stitch) @lua/includes/extensions/table.lua:60 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (337/stitch) @lua/postprocess/stereoscopy.lua:44 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- @lua/includes/modules/notification.lua:139 -- NYI: bytecode ISNEXT at @lua/includes/modules/notification.lua:144]
[TRACE FAIL --- @lua/includes/extensions/math.lua:39 -- leaving loop in root trace at @lua/includes/util/client.lua:14]
[TRACE FAIL --- (341/stitch) @lua/postprocess/dof.lua:47 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- @lua/includes/modules/notification.lua:139 -- NYI: bytecode ISNEXT at @lua/includes/modules/notification.lua:144]
[TRACE FAIL --- (348/stitch) @lua/autorun/client/gm_demo.lua:20 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/cl_search_models.lua:33 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/cl_search_models.lua:34]
[TRACE FAIL --- @lua/includes/extensions/client/player.lua:65 -- NYI: bytecode ISNEXT at @lua/includes/extensions/client/player.lua:67]
[TRACE FAIL --- (353/stitch) @lua/postprocess/toytown.lua:32 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (355/stitch) @lua/postprocess/sharpen.lua:26 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- @lua/includes/modules/notification.lua:139 -- NYI: bytecode ISNEXT at @lua/includes/modules/notification.lua:144]
[TRACE FAIL --- (356/stitch) @lua/postprocess/bokeh_dof.lua:40 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- @gamemodes/sandbox/gamemode/cl_search_models.lua:33 -- NYI: bytecode UCLO at @gamemodes/sandbox/gamemode/cl_search_models.lua:34]
[TRACE FAIL --- @lua/includes/extensions/math.lua:39 -- leaving loop in root trace at @lua/includes/util/client.lua:14]
[TRACE FAIL --- (4/0) @lua/includes/modules/list.lua:30 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/hoverball.lua:220]
[TRACE FAIL --- (4/0) @lua/includes/modules/list.lua:30 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/lamp.lua:280]
[TRACE FAIL --- (5/0) @lua/includes/modules/list.lua:40 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/physprop.lua:63]
[TRACE FAIL --- (5/0) @lua/includes/modules/list.lua:40 -- NYI: bytecode UCLO at @gamemodes/sandbox/entities/weapons/gmod_tool/stools/thruster.lua:290]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
[TRACE FAIL --- @lua/includes/modules/scripted_ents.lua:22 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:24]
[TRACE FAIL --- @lua/includes/modules/scripted_ents.lua:153 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:164]
[TRACE FAIL --- @lua/includes/modules/scripted_ents.lua:153 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:164]
[TRACE FAIL --- (11/stitch) @gamemodes/sandbox/entities/weapons/gmod_tool/stools/nocollide.lua:100 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (12/stitch) @gamemodes/sandbox/entities/weapons/gmod_tool/stools/nocollide.lua:100 -- NYI: bytecode ITERN at @lua/includes/modules/hook.lua:77]
[TRACE FAIL --- (18/0) @lua/includes/modules/scripted_ents.lua:156 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:164]
[TRACE FAIL --- (18/0) @lua/includes/modules/scripted_ents.lua:156 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:164]
[TRACE FAIL --- (18/0) @lua/includes/modules/scripted_ents.lua:156 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:164]
[TRACE FAIL --- (18/0) @lua/includes/modules/scripted_ents.lua:156 -- NYI: bytecode ISNEXT at @lua/includes/modules/scripted_ents.lua:164]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
[TRACE FAIL --- @lua/includes/extensions/table.lua:24 -- NYI: bytecode ISNEXT at @lua/includes/extensions/table.lua:29]
@ExtReMLapin
Copy link
Author

assert(jit.version_num == 20100, "LuaJIT core/library version mismatch")
local PRINT_FAIL_ONLY = true

local vmdef = {
	bcnames = "ISLT  ISGE  ISLE  ISGT  ISEQV ISNEV ISEQS ISNES ISEQN ISNEN ISEQP ISNEP ISTC  ISFC  IST   ISF   ISTYPEISNUM MOV   NOT   UNM   LEN   ADDVN SUBVN MULVN DIVVN MODVN ADDNV SUBNV MULNV DIVNV MODNV ADDVV SUBVV MULVV DIVVV MODVV POW   CAT   KSTR  KCDATAKSHORTKNUM  KPRI  KNIL  UGET  USETV USETS USETN USETP UCLO  FNEW  TNEW  TDUP  GGET  GSET  TGETV TGETS TGETB TGETR TSETV TSETS TSETB TSETM TSETR CALLM CALL  CALLMTCALLT ITERC ITERN VARG  ISNEXTRETM  RET   RET0  RET1  FORI  JFORI FORL  IFORL JFORL ITERL IITERLJITERLLOOP  ILOOP JLOOP JMP   FUNCF IFUNCFJFUNCFFUNCV IFUNCVJFUNCVFUNCC FUNCCW",
	irnames = "LT    GE    LE    GT    ULT   UGE   ULE   UGT   EQ    NE    ABC   RETF  NOP   BASE  PVAL  GCSTEPHIOP  LOOP  USE   PHI   RENAMEPROF  KPRI  KINT  KGC   KPTR  KKPTR KNULL KNUM  KINT64KSLOT BNOT  BSWAP BAND  BOR   BXOR  BSHL  BSHR  BSAR  BROL  BROR  ADD   SUB   MUL   DIV   MOD   POW   NEG   ABS   ATAN2 LDEXP MIN   MAX   FPMATHADDOV SUBOV MULOV AREF  HREFK HREF  NEWREFUREFO UREFC FREF  STRREFLREF  ALOAD HLOAD ULOAD FLOAD XLOAD SLOAD VLOAD ASTOREHSTOREUSTOREFSTOREXSTORESNEW  XSNEW TNEW  TDUP  CNEW  CNEWI BUFHDRBUFPUTBUFSTRTBAR  OBAR  XBAR  CONV  TOBIT TOSTR STRTO CALLN CALLA CALLL CALLS CALLXSCARG  ",
	irfpm = {
		[0] = "floor",
"ceil", "trunc", "sqrt", "exp", "exp2", "log", "log2", "log10", "sin", "cos", "tan", "other"
	},
	irfield = {
		[0] = "str.len",
"func.env", "func.pc", "func.ffid", "thread.env", "tab.meta", "tab.array", "tab.node", "tab.asize", "tab.hmask", "tab.nomm", "udata.meta", "udata.udtype", "udata.file", "cdata.ctypeid", "cdata.ptr", "cdata.int", "cdata.int64", "cdata.int64_4"
	},
	ircall = {
		[0] = "lj_str_cmp",
"lj_str_find", "lj_str_new", "lj_strscan_num", "lj_strfmt_int", "lj_strfmt_num", "lj_strfmt_char", "lj_strfmt_putint", "lj_strfmt_putnum", "lj_strfmt_putquoted", "lj_strfmt_putfxint", "lj_strfmt_putfnum_int", "lj_strfmt_putfnum_uint", "lj_strfmt_putfnum", "lj_strfmt_putfstr", "lj_strfmt_putfchar", "lj_buf_putmem", "lj_buf_putstr", "lj_buf_putchar", "lj_buf_putstr_reverse", "lj_buf_putstr_lower", "lj_buf_putstr_upper", "lj_buf_putstr_rep", "lj_buf_puttab", "lj_buf_tostr", "lj_tab_new_ah", "lj_tab_new1", "lj_tab_dup", "lj_tab_clear", "lj_tab_newkey", "lj_tab_len", "lj_gc_step_jit", "lj_gc_barrieruv", "lj_mem_newgco", "lj_math_random_step", "lj_vm_modi", "sinh", "cosh", "tanh", "fputc", "fwrite", "fflush", "lj_vm_floor", "lj_vm_ceil", "lj_vm_trunc", "sqrt", "exp", "lj_vm_exp2", "log", "lj_vm_log2", "log10", "sin", "cos", "tan", "lj_vm_powi", "pow", "atan2", "ldexp", "lj_vm_tobit", "softfp_add", "softfp_sub", "softfp_mul", "softfp_div", "softfp_cmp", "softfp_i2d", "softfp_d2i", "lj_vm_sfmin", "lj_vm_sfmax", "lj_vm_tointg", "softfp_ui2d", "softfp_f2d", "softfp_d2ui", "softfp_d2f", "softfp_i2f", "softfp_ui2f", "softfp_f2i", "softfp_f2ui", "fp64_l2d", "fp64_ul2d", "fp64_l2f", "fp64_ul2f", "fp64_d2l", "fp64_d2ul", "fp64_f2l", "fp64_f2ul", "lj_carith_divi64", "lj_carith_divu64", "lj_carith_modi64", "lj_carith_modu64", "lj_carith_powi64", "lj_carith_powu64", "lj_cdata_newv", "lj_cdata_setfin", "strlen", "memcpy", "memset", "lj_vm_errno", "lj_carith_mul64", "lj_carith_shl64", "lj_carith_shr64", "lj_carith_sar64", "lj_carith_rol64", "lj_carith_ror64"
	},
	traceerr = {
		[0] = "error thrown or hook called during recording",
"trace too short", "trace too long", "trace too deep", "too many snapshots", "blacklisted", "retry recording", "NYI: bytecode %s", "leaving loop in root trace", "inner loop in root trace", "loop unroll limit reached", "bad argument type", "JIT compilation disabled for function", "call unroll limit reached", "down-recursion, restarting", "NYI: unsupported variant of FastFunc %s", "NYI: return to lower frame", "store with nil or NaN key", "missing metamethod", "looping index lookup", "NYI: mixed sparse/dense table", "symbol not in cache", "NYI: unsupported C type conversion", "NYI: unsupported C function type", "guard would always fail", "too many PHIs", "persistent type instability", "failed to allocate mcode memory", "machine code too long", "hit mcode limit (retrying)", "too many spill slots", "inconsistent register allocation", "NYI: cannot assemble IR instruction %d", "NYI: PHI shuffling too complex", "NYI: register coalescing too complex"
	},
	ffnames = {
		[0] = "Lua",
"C", "assert", "type", "next", "pairs", "ipairs_aux", "ipairs", "getmetatable", "setmetatable", "getfenv", "setfenv", "rawget", "rawset", "rawequal", "unpack", "select", "tonumber", "tostring", "error", "pcall", "xpcall", "loadfile", "load", "loadstring", "dofile", "gcinfo", "collectgarbage", "newproxy", "print", "coroutine.status", "coroutine.running", "coroutine.isyieldable", "coroutine.create", "coroutine.yield", "coroutine.resume", "coroutine.wrap_aux", "coroutine.wrap", "math.abs", "math.floor", "math.ceil", "math.sqrt", "math.log10", "math.exp", "math.sin", "math.cos", "math.tan", "math.asin", "math.acos", "math.atan", "math.sinh", "math.cosh", "math.tanh", "math.frexp", "math.modf", "math.log", "math.atan2", "math.pow", "math.fmod", "math.ldexp", "math.min", "math.max", "math.random", "math.randomseed", "bit.tobit", "bit.bnot", "bit.bswap", "bit.lshift", "bit.rshift", "bit.arshift", "bit.rol", "bit.ror", "bit.band", "bit.bor", "bit.bxor", "bit.tohex", "string.byte", "string.char", "string.sub", "string.rep", "string.reverse", "string.lower", "string.upper", "string.dump", "string.find", "string.match", "string.gmatch_aux", "string.gmatch", "string.gsub", "string.format", "table.maxn", "table.insert", "table.concat", "table.sort", "table.new", "table.clear", "io.method.close", "io.method.read", "io.method.write", "io.method.flush", "io.method.seek", "io.method.setvbuf", "io.method.lines", "io.method.__gc", "io.method.__tostring", "io.open", "io.popen", "io.tmpfile", "io.close", "io.read", "io.write", "io.flush", "io.input", "io.output", "io.lines", "io.type", "os.execute", "os.remove", "os.rename", "os.tmpname", "os.getenv", "os.exit", "os.clock", "os.date", "os.time", "os.difftime", "os.setlocale", "debug.getregistry", "debug.getmetatable", "debug.setmetatable", "debug.getfenv", "debug.setfenv", "debug.getinfo", "debug.getlocal", "debug.setlocal", "debug.getupvalue", "debug.setupvalue", "debug.upvalueid", "debug.upvaluejoin", "debug.sethook", "debug.gethook", "debug.debug", "debug.traceback", "jit.on", "jit.off", "jit.flush", "jit.status", "jit.attach", "jit.util.funcinfo", "jit.util.funcbc", "jit.util.funck", "jit.util.funcuvname", "jit.util.traceinfo", "jit.util.traceir", "jit.util.tracek", "jit.util.tracesnap", "jit.util.tracemc", "jit.util.traceexitstub", "jit.util.ircalladdr", "jit.opt.start", "jit.profile.start", "jit.profile.stop", "jit.profile.dumpstack", "ffi.meta.__index", "ffi.meta.__newindex", "ffi.meta.__eq", "ffi.meta.__len", "ffi.meta.__lt", "ffi.meta.__le", "ffi.meta.__concat", "ffi.meta.__call", "ffi.meta.__add", "ffi.meta.__sub", "ffi.meta.__mul", "ffi.meta.__div", "ffi.meta.__mod", "ffi.meta.__pow", "ffi.meta.__unm", "ffi.meta.__tostring", "ffi.meta.__pairs", "ffi.meta.__ipairs", "ffi.clib.__index", "ffi.clib.__newindex", "ffi.clib.__gc", "ffi.callback.free", "ffi.callback.set", "ffi.cdef", "ffi.new", "ffi.cast", "ffi.typeof", "ffi.typeinfo", "ffi.istype", "ffi.sizeof", "ffi.alignof", "ffi.offsetof", "ffi.errno", "ffi.string", "ffi.copy", "ffi.fill", "ffi.abi", "ffi.metatype", "ffi.gc", "ffi.load"
	}
}

--changed
-- "NYI: bytecode %d"
--to
-- "NYI: bytecode %s"
local INST = {}
local OPNAMES = {}

do
	local i = 0

	for str in vmdef.bcnames:gmatch"......" do
		str = str:gsub("%s", "")
		OPNAMES[i] = str
		INST[str] = i
		i = i + 1
	end
end

local funcinfo, traceinfo = jit.util.funcinfo, jit.util.traceinfo
local type, format = type, string.format
------------------------------------------------------------------------------
local startloc, startex

local function fmtfunc(func, pc)
	local fi = funcinfo(func, pc)

	if fi.loc then
		return (fi.source .. ":" .. tostring(fi.currentline))
	elseif fi.ffid then
		return vmdef.ffnames[fi.ffid]
	elseif fi.addr then
		return format("C:%x", fi.addr)
	else
		return "(?)"
	end
end

-- Format trace error message.
local function fmterr(err, info)
	if type(err) == "number" then
		if type(info) == "function" then
			info = fmtfunc(info)
		end

		if err == 7 then
			info = OPNAMES[info]
		end

		err = format(vmdef.traceerr[err], info)
	end

	return err
end

local reportList = {}

-- Dump trace states.
local function dump_trace(what, tr, func, pc, otr, oex)
	if what == "start" then
		startloc = fmtfunc(func, pc)
		startex = otr and "(" .. otr .. "/" .. (oex == -1 and "stitch" or oex) .. ") " or ""
	else
		if what == "abort" then
			local loc = fmtfunc(func, pc)

			if loc ~= startloc then
				table.insert(reportList, format("[TRACE FAIL --- %s%s -- %s at %s]\n", startex, startloc, fmterr(otr, oex), loc))
			else
				table.insert(reportList, format("[TRACE FAIL --- %s%s -- %s]\n", startex, startloc, fmterr(otr, oex)))
			end
		elseif what == "stop" and not PRINT_FAIL_ONLY then
			local info = traceinfo(tr)
			local link, ltype = info.link, info.linktype

			if ltype == "interpreter" then
				table.insert(reportList, format("[TRACE %s %s%s -- fallback to interpreter]\n", tr, startex, startloc))
			elseif ltype == "stitch" then
				table.insert(reportList, format("[TRACE %s %s%s %s %s]\n", tr, startex, startloc, ltype, fmtfunc(func, pc)))
			elseif link == tr or link == 0 then
				table.insert(reportList, format("[TRACE %s %s%s %s]\n", tr, startex, startloc, ltype))
			elseif ltype == "root" then
				table.insert(reportList, format("[TRACE %s %s%s -> %d]\n", tr, startex, startloc, link))
			else
				table.insert(reportList, format("[TRACE %s %s%s -> %d %s]\n", tr, startex, startloc, link, ltype))
			end
		elseif not PRINT_FAIL_ONLY then
			table.insert(reportList, format("[TRACE %s]\n", what))
		end
	end
end

------------------------------------------------------------------------------
-- Detach dump handlers.
local function dumpoff()
	jit.attach(dump_trace)
	local fileName = "cl_jit_trace.txt"

	if SERVER then
		fileName = "sv_jit_trace.txt"
	end

	file.Write(fileName, table.concat(reportList))
end

-- Open the output file and attach dump handlers.
local function dumpon()
	jit.attach(dump_trace, "trace")
end

if SERVER then
	concommand.Add("sv_jitdebug_start", dumpon)
	concommand.Add("sv_jitdebug_stop", dumpoff)
else
	concommand.Add("cl_jitdebug_start", dumpon)
	concommand.Add("cl_jitdebug_stop", dumpoff)
end

dumpon()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment