Skip to content

Commit e79a92b

Browse files
committed
refine comments
1 parent f845364 commit e79a92b

1 file changed

Lines changed: 19 additions & 18 deletions

File tree

nattlua/other/jit_options.lua

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,29 @@ end
1919
local GC64 = #tostring({}) == 19
2020
-- https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_jit.h#L116-L137
2121
local default_options = {
22-
--
23-
maxtrace = 1000, -- 1 > 65535: Max number of of traces in cache.
24-
maxrecord = 4000, -- Max number of of recorded IR instructions.
25-
maxirconst = 500, -- Max number of of IR constants of a trace.
26-
maxside = 100, -- Max number of of side traces of a root trace.
27-
maxsnap = 500, -- Max number of of snapshots for a trace.
28-
minstitch = 0, -- Min number of of IR ins for a stitched trace.
29-
--
30-
hotloop = 56, -- number of iter. to detect a hot loop/call.
31-
hotexit = 10, -- number of taken exits to start a side trace.
32-
tryside = 4, -- number of attempts to compile a side trace.
33-
--
34-
instunroll = 4, -- max unroll attempts for loops with an unknown iteration count before falling back to normal loop construct
35-
loopunroll = 15, -- max unroll for loop ops in side traces.
36-
callunroll = 3, -- max depth for recursive calls.
37-
recunroll = 2, -- min unroll for true recursion.
38-
--
22+
-- trace cache limits
23+
maxtrace = 1000, -- 1 >= 65535: Max number of traces in cache
24+
maxmcode = 512, -- max total size of all machine code areas (in KBytes).
3925
-- size of each machine code area (in KBytes).
4026
-- See: https://devblogs.microsoft.com/oldnewthing/20031008-00/?p=42223
4127
-- Could go as low as 4K, but the mmap() overhead would be rather high.
4228
sizemcode = jit.os == "Windows" or GC64 and 64 or 32,
43-
maxmcode = 512, -- max total size of all machine code areas (in KBytes).
29+
-- trace size limits
30+
maxrecord = 4000, -- Max number of recorded IR instructions
31+
maxirconst = 500, -- Max number of IR constants of a trace
32+
maxsnap = 500, -- Max number of snapshots for a trace
33+
-- side trace limits
34+
minstitch = 0, -- Min number of IR instructions for a stitched trace. depends on maxrecord
35+
maxside = 100, -- Max number of side traces of a root trace
36+
-- hotness thresholds
37+
hotloop = 56, -- loop iterations to start a trace (functions need hotloop*2 calls)
38+
hotexit = 10, -- times a trace exit must be taken to start a side trace. depends on maxside
39+
tryside = 4, -- number of attempts to compile a side trace
40+
-- unroll heuristics
41+
instunroll = 4, -- max unroll attempts for loops with instable types.
42+
loopunroll = 15, -- max unroll for loop ops in side traces.
43+
callunroll = 3, -- max depth for recursive calls.
44+
recunroll = 2, -- min unroll for true recursion.
4445
--
4546
}
4647
-- https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_jit.h#L93-L103

0 commit comments

Comments
 (0)