[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/+/1627341
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61798}
This commit is contained in:
Clemens Hammacher 2019-05-23 12:30:39 +02:00 committed by Commit Bot
parent 0eae59594f
commit 93526b8543

View File

@ -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();