aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Pall <mike>2011-02-05 21:50:15 +0100
committerMike Pall <mike>2011-02-05 21:50:15 +0100
commit26fadcd25bb9e84e15be0a81a56806d5419c3183 (patch)
tree91bb326735cb745093d63845027f4bff238b3dc3 /lib
parentbf05209e1446aa13416b3dfffe021c85057b9a5d (diff)
downloadluajit-26fadcd25bb9e84e15be0a81a56806d5419c3183.tar.gz
luajit-26fadcd25bb9e84e15be0a81a56806d5419c3183.tar.bz2
luajit-26fadcd25bb9e84e15be0a81a56806d5419c3183.zip
FFI: Record simple C function calls.
Only handles cdecl and fixarg C functions. Doesn't handle pass-by-value aggregates. Doesn't handle 64 bit args/returns on 32 bit CPUs.
Diffstat (limited to 'lib')
-rw-r--r--lib/dump.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/dump.lua b/lib/dump.lua
index 555b4b45..652761ff 100644
--- a/lib/dump.lua
+++ b/lib/dump.lua
@@ -429,9 +429,15 @@ local function dump_ir(tr, dumpsnap, dumpreg)
429 band(ot, 128) == 0 and " " or ">", 429 band(ot, 128) == 0 and " " or ">",
430 band(ot, 64) == 0 and " " or "+", 430 band(ot, 64) == 0 and " " or "+",
431 irtype[t], op)) 431 irtype[t], op))
432 local m1 = band(m, 3) 432 local m1, m2 = band(m, 3), band(m, 3*4)
433 if sub(op, 1, 4) == "CALL" then 433 if sub(op, 1, 4) == "CALL" then
434 out:write(format("%-10s (", vmdef.ircall[op2])) 434 if m2 == 1*4 then -- op2 == IRMlit
435 out:write(format("%-10s (", vmdef.ircall[op2]))
436 elseif op2 < 0 then
437 out:write(format("[0x%x](", tonumber((tracek(tr, op2)))))
438 else
439 out:write(format("%04d (", op2))
440 end
435 if op1 ~= -1 then dumpcallargs(tr, op1) end 441 if op1 ~= -1 then dumpcallargs(tr, op1) end
436 out:write(")") 442 out:write(")")
437 elseif op == "CNEW " and op2 == -1 then 443 elseif op == "CNEW " and op2 == -1 then
@@ -442,7 +448,6 @@ local function dump_ir(tr, dumpsnap, dumpreg)
442 else 448 else
443 out:write(format(m1 == 0 and "%04d" or "#%-3d", op1)) 449 out:write(format(m1 == 0 and "%04d" or "#%-3d", op1))
444 end 450 end
445 local m2 = band(m, 3*4)
446 if m2 ~= 3*4 then -- op2 != IRMnone 451 if m2 ~= 3*4 then -- op2 != IRMnone
447 if m2 == 1*4 then -- op2 == IRMlit 452 if m2 == 1*4 then -- op2 == IRMlit
448 local litn = litname[op] 453 local litn = litname[op]