Commit 93526b85 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][gc] Lower limit to trigger GC

Since we currently require at least 1 MB of code to be potentially
dead, we will never trigger GC for small modules.
This CL lowers the threshold to 64 kB (plus 10% of committed code
space), which has basically no effect on large modules, but ensures
that we also run GCs on small modules.

R=mstarzinger@chromium.org

Bug: v8:8217
Change-Id: Ie76787af5ec7deb2e335303c2a98b81aeae6d4ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1627341Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61798}
parent 0eae5959
......@@ -774,11 +774,11 @@ bool WasmEngine::AddPotentiallyDeadCode(WasmCode* code) {
if (!added.second) return false; // An entry already existed.
new_potentially_dead_code_size_ += code->instructions().size();
if (FLAG_wasm_code_gc) {
// Trigger a GC if 1MiB plus 10% of committed code are potentially dead.
// Trigger a GC if 64kB plus 10% of committed code are potentially dead.
size_t dead_code_limit =
FLAG_stress_wasm_code_gc
? 0
: 1 * MB + code_manager_.committed_code_space() / 10;
: 64 * KB + code_manager_.committed_code_space() / 10;
if (new_potentially_dead_code_size_ > dead_code_limit) {
bool inc_gc_count =
info->num_code_gcs_triggered < std::numeric_limits<int8_t>::max();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment