Commit 518ae54d authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Enable global memory scheduling flag

The default values ensure that the controller doesn't change scheduling if no
values are reported from the embedder.

This allows for switching the flag on the embedder side.

Bug: chromium:948807
Change-Id: Ib478adc1185ed5e56d06ba4404d6cafb196cff78
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1672930Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62330}
parent 88d23496
......@@ -746,7 +746,7 @@ DEFINE_BOOL(huge_max_old_generation_size, false,
"Increase max size of the old space to 4 GB for x64 systems with"
"the physical memory bigger than 16 GB")
DEFINE_SIZE_T(initial_old_space_size, 0, "initial old space size (in Mbytes)")
DEFINE_BOOL(global_gc_scheduling, false,
DEFINE_BOOL(global_gc_scheduling, true,
"enable GC scheduling based on global memory")
DEFINE_BOOL(gc_global, false, "always perform global GCs")
DEFINE_INT(random_gc_interval, 0,
......
......@@ -962,10 +962,9 @@ double GCTracer::IncrementalMarkingSpeedInBytesPerMillisecond() const {
}
double GCTracer::EmbedderSpeedInBytesPerMillisecond() const {
if (recorded_embedder_speed_ != 0.0) {
return recorded_embedder_speed_;
}
return kConservativeSpeedInBytesPerMillisecond;
// Note: Returning 0 is ok here as callers check for whether embedder speeds
// have been recorded at all.
return recorded_embedder_speed_;
}
double GCTracer::ScavengeSpeedInBytesPerMillisecond(
......
......@@ -4660,7 +4660,7 @@ size_t Heap::GlobalMemoryAvailable() {
? GlobalSizeOfObjects() < global_allocation_limit_
? global_allocation_limit_ - GlobalSizeOfObjects()
: 0
: 1;
: new_space_->Capacity() + 1;
}
// This function returns either kNoLimit, kSoftLimit, or kHardLimit.
......@@ -4726,7 +4726,7 @@ Heap::IncrementalMarkingLimit Heap::IncrementalMarkingLimitReached() {
const size_t global_memory_available = GlobalMemoryAvailable();
if (old_generation_space_available > new_space_->Capacity() &&
(global_memory_available > 0)) {
(global_memory_available > new_space_->Capacity())) {
return IncrementalMarkingLimit::kNoLimit;
}
if (ShouldOptimizeForMemoryUsage()) {
......
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