diff options
author | Mike Pall <mike> | 2010-10-11 21:13:37 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-10-11 21:13:37 +0200 |
commit | b3cf2c70f4250c80408399c591743e7b6667b840 (patch) | |
tree | f784294c5d13064f2509ea4bf86df506a1eed8d6 /lib | |
parent | cc62edebfdf3fa451a745ee2936c8df72c9e7243 (diff) | |
download | luajit-b3cf2c70f4250c80408399c591743e7b6667b840.tar.gz luajit-b3cf2c70f4250c80408399c591743e7b6667b840.tar.bz2 luajit-b3cf2c70f4250c80408399c591743e7b6667b840.zip |
Decouple SLOAD type and optional conversion.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dump.lua | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/dump.lua b/lib/dump.lua index b0a334e6..7bee9e79 100644 --- a/lib/dump.lua +++ b/lib/dump.lua | |||
@@ -213,11 +213,17 @@ local colorize, irtype | |||
213 | 213 | ||
214 | -- Lookup table to convert some literals into names. | 214 | -- Lookup table to convert some literals into names. |
215 | local litname = { | 215 | local litname = { |
216 | ["SLOAD "] = { [0] = "", "I", "R", "RI", "P", "PI", "PR", "PRI", | 216 | ["SLOAD "] = setmetatable({}, { __index = function(t, mode) |
217 | "T", "IT", "RT", "RIT", "PT", "PIT", "PRT", "PRIT", | 217 | local s = "" |
218 | "F", "IF", "RF", "RIF", "PF", "PIF", "PRF", "PRIF", | 218 | if band(mode, 1) ~= 0 then s = s.."P" end |
219 | "TF", "ITF", "RTF", "RITF", "PTF", "PITF", "PRTF", "PRITF", | 219 | if band(mode, 2) ~= 0 then s = s.."F" end |
220 | }, | 220 | if band(mode, 4) ~= 0 then s = s.."T" end |
221 | if band(mode, 8) ~= 0 then s = s.."C" end | ||
222 | if band(mode, 16) ~= 0 then s = s.."R" end | ||
223 | if band(mode, 32) ~= 0 then s = s.."I" end | ||
224 | t[mode] = s | ||
225 | return s | ||
226 | end}), | ||
221 | ["XLOAD "] = { [0] = "", "R", "U", "RU", }, | 227 | ["XLOAD "] = { [0] = "", "R", "U", "RU", }, |
222 | ["TOINT "] = { [0] = "check", "index", "", }, | 228 | ["TOINT "] = { [0] = "check", "index", "", }, |
223 | ["FLOAD "] = vmdef.irfield, | 229 | ["FLOAD "] = vmdef.irfield, |