diff options
Diffstat (limited to 'src/lj_trace.c')
-rw-r--r-- | src/lj_trace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c index c4e728c6..77e9d05b 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "lj_vm.h" | 30 | #include "lj_vm.h" |
31 | #include "lj_vmevent.h" | 31 | #include "lj_vmevent.h" |
32 | #include "lj_target.h" | 32 | #include "lj_target.h" |
33 | #include "lj_prng.h" | ||
33 | 34 | ||
34 | /* -- Error handling ------------------------------------------------------ */ | 35 | /* -- Error handling ------------------------------------------------------ */ |
35 | 36 | ||
@@ -384,7 +385,7 @@ static void penalty_pc(jit_State *J, GCproto *pt, BCIns *pc, TraceError e) | |||
384 | if (mref(J->penalty[i].pc, const BCIns) == pc) { /* Cache slot found? */ | 385 | if (mref(J->penalty[i].pc, const BCIns) == pc) { /* Cache slot found? */ |
385 | /* First try to bump its hotcount several times. */ | 386 | /* First try to bump its hotcount several times. */ |
386 | val = ((uint32_t)J->penalty[i].val << 1) + | 387 | val = ((uint32_t)J->penalty[i].val << 1) + |
387 | LJ_PRNG_BITS(J, PENALTY_RNDBITS); | 388 | (lj_prng_u64(&J2G(J)->prng) & ((1u<<PENALTY_RNDBITS)-1)); |
388 | if (val > PENALTY_MAX) { | 389 | if (val > PENALTY_MAX) { |
389 | blacklist_pc(pt, pc); /* Blacklist it, if that didn't help. */ | 390 | blacklist_pc(pt, pc); /* Blacklist it, if that didn't help. */ |
390 | return; | 391 | return; |