Commit 215a2506 authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

Introduced gc flag for fuzzing over incremental marking limit.

Bug: v8:6972
Change-Id: I9e341f980ca392920e0789121707e25916981265
Reviewed-on: https://chromium-review.googlesource.com/730383Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michał Majewski <majeski@google.com>
Cr-Commit-Position: refs/heads/master@{#48886}
parent af424eea
......@@ -674,6 +674,8 @@ DEFINE_BOOL(stress_compaction, false,
"--force_marking_deque_overflows)")
DEFINE_BOOL(stress_incremental_marking, false,
"force incremental marking for small heaps and run it more often")
DEFINE_INT(stress_incremental_marking_percentage, 0,
"force incremental marking after X percent of the standard limit")
DEFINE_BOOL(manual_evacuation_candidates_selection, false,
"Test mode only flag. It allows an unit test to select evacuation "
"candidates pages (requires --stress_compaction).")
......
......@@ -5299,7 +5299,31 @@ Heap::IncrementalMarkingLimit Heap::IncrementalMarkingLimitReached() {
// start marking immediately.
return IncrementalMarkingLimit::kHardLimit;
}
if (FLAG_stress_incremental_marking_percentage > 0) {
double gained_since_last_gc =
PromotedSinceLastGC() +
(external_memory_ - external_memory_at_last_mark_compact_);
double size_before_gc = PromotedTotalSize() - gained_since_last_gc;
double bytes_to_limit = old_generation_allocation_limit_ - size_before_gc;
if (bytes_to_limit > 0) {
double current_percent = (gained_since_last_gc / bytes_to_limit) * 100.0;
if (FLAG_trace_incremental_marking) {
isolate()->PrintWithTimestamp(
"[IncrementalMarking] %.2lf%% of the memory limit reached\n",
current_percent);
}
if (static_cast<int>(current_percent) >=
FLAG_stress_incremental_marking_percentage) {
return IncrementalMarkingLimit::kHardLimit;
}
}
}
size_t old_generation_space_available = OldGenerationSpaceAvailable();
if (old_generation_space_available > new_space_->Capacity()) {
return IncrementalMarkingLimit::kNoLimit;
}
......
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