LuaJIT
≈ 1 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
LuaJIT is a tracing just-in-time compiler and interpreter for the Lua programming language.
LuaJIT is a tracing just-in-time compiler and interpreter for the Lua programming language. -- Loop with if-statement local x = 0 for i=1,1e4 do x = x + 11 if i%10 == 0 then -- if-statement x = x + 22 end x = x + 33 end ---- TRACE 1 start Ex.lua:5 ---- TRACE 1 IR 0001 int SLOAD #2 CI 0002 > num SLOAD #1 T 0003 num ADD 0002 +11 0004 int MOD 0001 +10 0005 > int NE 0004 +0 0006 + num ADD 0003 +33 0007 + int ADD 0001 +1 0008 > int LE 0007 +10000 0009 ------ LOOP ------------ 0010 num ADD 0006 +11 0011 int MOD 0007 +10 0012 > int NE 0011 +0 0013 + num ADD 0010 +33 0014 + int ADD 0007 +1 0015 > int LE 0014 +10000 0016 int PHI 0007 0014 0017 num PHI 0006 0013 ---- TRACE 1 stop -> loop ---- TRACE 2 start 1/4 Ex.lua:8 ---- TRACE 2 IR 0001 num SLOAD #1 PI 0002 int SLOAD #2 PI 0003 num ADD 0001 +22 0004 num ADD 0003 +33 0005 int ADD 0002 +1 0006 > int LE 0005 +10000 0007 num CONV 0005 num.int ---- TRACE 2 stop -> 1
Text derived from https://en.wikipedia.org/w/index.php?oldid=1361351583 under CC BY-SA 4.0; modifications have been made.