You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[wasm] add a total wasm bytes quota to the jiterpreter; adjust parameters (#80266)
* Adjust jiterpreter parameters to avoid making S.T.J AOT tests slower
* Add a total wasm bytes quota to the jiterpreter to avoid generating way too much code in degenerate cases
Copy file name to clipboardExpand all lines: src/mono/mono/utils/options-def.h
+8-5Lines changed: 8 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -107,17 +107,20 @@ DEFINE_BOOL(jiterpreter_dump_traces, "jiterpreter-dump-traces", FALSE, "Dump the
107
107
// Currently reduces performance significantly :(
108
108
DEFINE_BOOL(jiterpreter_use_constants, "jiterpreter-use-constants", FALSE, "Use runtime imports for pointer constants")
109
109
// any trace that doesn't have at least this many meaningful (non-nop) opcodes in it will be rejected
110
-
DEFINE_INT(jiterpreter_minimum_trace_length, "jiterpreter-minimum-trace-length", 8, "Reject traces shorter than this number of meaningful opcodes")
110
+
DEFINE_INT(jiterpreter_minimum_trace_length, "jiterpreter-minimum-trace-length", 10, "Reject traces shorter than this number of meaningful opcodes")
111
111
// once a trace entry point is inserted, we only actually JIT code for it once it's been hit this many times
112
112
DEFINE_INT(jiterpreter_minimum_trace_hit_count, "jiterpreter-minimum-trace-hit-count", 5000, "JIT trace entry points once they are hit this many times")
113
113
// After a do_jit_call call site is hit this many times, we will queue it to be jitted
114
-
DEFINE_INT(jiterpreter_jit_call_trampoline_hit_count, "jiterpreter-jit-call-hit-count", 2000, "Queue specialized do_jit_call trampoline for JIT after this many hits")
114
+
DEFINE_INT(jiterpreter_jit_call_trampoline_hit_count, "jiterpreter-jit-call-hit-count", 1000, "Queue specialized do_jit_call trampoline for JIT after this many hits")
115
115
// After a do_jit_call call site is hit this many times without being jitted, we will flush the JIT queue
116
-
DEFINE_INT(jiterpreter_jit_call_queue_flush_threshold, "jiterpreter-jit-call-queue-flush-threshold", 8000, "Flush the do_jit_call JIT queue after an unJITted call site has this many hits")
116
+
DEFINE_INT(jiterpreter_jit_call_queue_flush_threshold, "jiterpreter-jit-call-queue-flush-threshold", 6000, "Flush the do_jit_call JIT queue after an unJITted call site has this many hits")
117
117
// After a generic interp_entry wrapper is hit this many times, we will queue it to be jitted
118
-
DEFINE_INT(jiterpreter_interp_entry_trampoline_hit_count, "jiterpreter-interp-entry-hit-count", 250, "Queue specialized interp_entry wrapper for JIT after this many hits")
118
+
DEFINE_INT(jiterpreter_interp_entry_trampoline_hit_count, "jiterpreter-interp-entry-hit-count", 1000, "Queue specialized interp_entry wrapper for JIT after this many hits")
119
119
// After a generic interp_entry wrapper is hit this many times without being jitted, we will flush the JIT queue
120
-
DEFINE_INT(jiterpreter_interp_entry_queue_flush_threshold, "jiterpreter-interp-entry-queue-flush-threshold", 1000, "Flush the interp_entry JIT queue after an unJITted call site has this many hits")
120
+
DEFINE_INT(jiterpreter_interp_entry_queue_flush_threshold, "jiterpreter-interp-entry-queue-flush-threshold", 3000, "Flush the interp_entry JIT queue after an unJITted call site has this many hits")
121
+
// In degenerate cases the jiterpreter could end up generating lots of WASM, so shut off jitting once it reaches this limit
122
+
// Each wasm byte likely maps to multiple bytes of native code, so it's important for this limit not to be too high
123
+
DEFINE_INT(jiterpreter_wasm_bytes_limit, "jiterpreter-wasm-bytes-limit", 6*1024*1024, "Disable jiterpreter code generation once this many bytes of WASM have been generated")
console.log(`// jiterpreter produced ${counters.tracesCompiled} traces from ${counters.traceCandidates} candidates (${(counters.tracesCompiled/counters.traceCandidates*100).toFixed(1)}%),${counters.jitCallsCompiled}jit_call trampolines, and ${counters.entryWrappersCompiled}interp_entry wrappers`);
0 commit comments