|
19 | 19 | local GC64 = #tostring({}) == 19 |
20 | 20 | -- https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_jit.h#L116-L137 |
21 | 21 | 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). |
39 | 25 | -- size of each machine code area (in KBytes). |
40 | 26 | -- See: https://devblogs.microsoft.com/oldnewthing/20031008-00/?p=42223 |
41 | 27 | -- Could go as low as 4K, but the mmap() overhead would be rather high. |
42 | 28 | 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. |
44 | 45 | -- |
45 | 46 | } |
46 | 47 | -- https://github.com/LuaJIT/LuaJIT/blob/v2.1/src/lj_jit.h#L93-L103 |
|
0 commit comments