summaryrefslogtreecommitdiff
path: root/src/lj_jit.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_jit.h')
-rw-r--r--src/lj_jit.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/lj_jit.h b/src/lj_jit.h
index 18069ac9..23adf30d 100644
--- a/src/lj_jit.h
+++ b/src/lj_jit.h
@@ -69,14 +69,14 @@
69 _(\007, maxside, 100) /* Max. # of side traces of a root trace. */ \ 69 _(\007, maxside, 100) /* Max. # of side traces of a root trace. */ \
70 _(\007, maxsnap, 100) /* Max. # of snapshots for a trace. */ \ 70 _(\007, maxsnap, 100) /* Max. # of snapshots for a trace. */ \
71 \ 71 \
72 _(\007, hotloop, 57) /* # of iterations to detect a hot loop. */ \ 72 _(\007, hotloop, 56) /* # of iter. to detect a hot loop/call. */ \
73 _(\007, hotexit, 10) /* # of taken exits to start a side trace. */ \ 73 _(\007, hotexit, 10) /* # of taken exits to start a side trace. */ \
74 _(\007, tryside, 4) /* # of attempts to compile a side trace. */ \ 74 _(\007, tryside, 4) /* # of attempts to compile a side trace. */ \
75 \ 75 \
76 _(\012, instunroll, 4) /* Max. unroll for instable loops. */ \ 76 _(\012, instunroll, 4) /* Max. unroll for instable loops. */ \
77 _(\012, loopunroll, 7) /* Max. unroll for loop ops in side traces. */ \ 77 _(\012, loopunroll, 7) /* Max. unroll for loop ops in side traces. */ \
78 _(\012, callunroll, 3) /* Max. unroll for recursive calls. */ \ 78 _(\012, callunroll, 3) /* Max. unroll for recursive calls. */ \
79 _(\011, recunroll, 2) /* Max. unroll for true recursion. */ \ 79 _(\011, recunroll, 2) /* Min. unroll for true recursion. */ \
80 \ 80 \
81 /* Size of each machine code area (in KBytes). */ \ 81 /* Size of each machine code area (in KBytes). */ \
82 _(\011, sizemcode, JIT_P_sizemcode_DEFAULT) \ 82 _(\011, sizemcode, JIT_P_sizemcode_DEFAULT) \
@@ -181,13 +181,15 @@ typedef struct Trace {
181 181
182/* Round-robin penalty cache for bytecodes leading to aborted traces. */ 182/* Round-robin penalty cache for bytecodes leading to aborted traces. */
183typedef struct HotPenalty { 183typedef struct HotPenalty {
184 const BCIns *pc; /* Starting bytecode PC. */ 184 MRef pc; /* Starting bytecode PC. */
185 uint16_t val; /* Penalty value, i.e. hotcount start. */ 185 uint16_t val; /* Penalty value, i.e. hotcount start. */
186 uint16_t reason; /* Abort reason (really TraceErr). */ 186 uint16_t reason; /* Abort reason (really TraceErr). */
187} HotPenalty; 187} HotPenalty;
188 188
189/* Number of slots for the penalty cache. Must be a power of 2. */ 189#define PENALTY_SLOTS 64 /* Penalty cache slot. Must be a power of 2. */
190#define PENALTY_SLOTS 16 190#define PENALTY_MIN 36 /* Minimum penalty value. */
191#define PENALTY_MAX 60000 /* Maximum penalty value. */
192#define PENALTY_RNDBITS 4 /* # of random bits to add to penalty value. */
191 193
192/* Round-robin backpropagation cache for narrowing conversions. */ 194/* Round-robin backpropagation cache for narrowing conversions. */
193typedef struct BPropEntry { 195typedef struct BPropEntry {
@@ -264,6 +266,7 @@ typedef struct jit_State {
264 266
265 HotPenalty penalty[PENALTY_SLOTS]; /* Penalty slots. */ 267 HotPenalty penalty[PENALTY_SLOTS]; /* Penalty slots. */
266 uint32_t penaltyslot; /* Round-robin index into penalty slots. */ 268 uint32_t penaltyslot; /* Round-robin index into penalty slots. */
269 uint32_t prngstate; /* PRNG state for penalty randomization. */
267 270
268 BPropEntry bpropcache[BPROP_SLOTS]; /* Backpropagation cache slots. */ 271 BPropEntry bpropcache[BPROP_SLOTS]; /* Backpropagation cache slots. */
269 uint32_t bpropslot; /* Round-robin index into bpropcache slots. */ 272 uint32_t bpropslot; /* Round-robin index into bpropcache slots. */