Rename some things around incremental marking triggers

R=hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1094843002

Cr-Commit-Position: refs/heads/master@{#27914}
This commit is contained in:
erikcorry 2015-04-17 04:17:33 -07:00 committed by Commit bot
parent 46c4c707e2
commit 1caa269cee
4 changed files with 13 additions and 21 deletions

View File

@ -874,7 +874,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
// Start incremental marking for the next cycle. The heap snapshot
// generator needs incremental marking to stay off after it aborted.
if (!mark_compact_collector()->abort_incremental_marking() &&
WorthActivatingIncrementalMarking()) {
incremental_marking()->IsStopped() &&
incremental_marking()->ShouldActivateEvenWithoutIdleNotification()) {
incremental_marking()->Start();
}
@ -4545,12 +4546,6 @@ bool Heap::TryFinalizeIdleIncrementalMarking(
}
bool Heap::WorthActivatingIncrementalMarking() {
return incremental_marking()->IsStopped() &&
incremental_marking()->ShouldActivate();
}
static double MonotonicallyIncreasingTimeInMs() {
return V8::GetCurrentPlatform()->MonotonicallyIncreasingTime() *
static_cast<double>(base::Time::kMillisecondsPerSecond);
@ -4588,8 +4583,8 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
}
heap_state.can_start_incremental_marking =
incremental_marking()->WorthActivating() &&
NextGCIsLikelyToBeFull(limit) && FLAG_incremental_marking &&
incremental_marking()->CanBeActivated() &&
HeapIsFullEnoughToStartIncrementalMarking(limit) &&
!mark_compact_collector()->sweeping_in_progress();
heap_state.sweeping_in_progress =
mark_compact_collector()->sweeping_in_progress();

View File

@ -1241,9 +1241,7 @@ class Heap {
survived_since_last_expansion_ += survived;
}
inline bool NextGCIsLikelyToBeFull(intptr_t limit) {
if (FLAG_gc_global) return true;
inline bool HeapIsFullEnoughToStartIncrementalMarking(intptr_t limit) {
if (FLAG_stress_compaction && (gc_count_ & 1) != 0) return true;
intptr_t adjusted_allocation_limit = limit - new_space_.Capacity();
@ -2083,8 +2081,6 @@ class Heap {
double idle_time_in_ms, size_t size_of_objects,
size_t mark_compact_speed_in_bytes_per_ms);
bool WorthActivatingIncrementalMarking();
void ClearObjectStats(bool clear_last_time_stats = false);
inline void UpdateAllocationsHash(HeapObject* object);

View File

@ -386,9 +386,9 @@ void IncrementalMarking::ActivateIncrementalWriteBarrier() {
}
bool IncrementalMarking::ShouldActivate() {
return WorthActivating() &&
heap_->NextGCIsLikelyToBeFull(
bool IncrementalMarking::ShouldActivateEvenWithoutIdleNotification() {
return CanBeActivated() &&
heap_->HeapIsFullEnoughToStartIncrementalMarking(
heap_->old_generation_allocation_limit());
}
@ -396,7 +396,7 @@ bool IncrementalMarking::ShouldActivate() {
bool IncrementalMarking::WasActivated() { return was_activated_; }
bool IncrementalMarking::WorthActivating() {
bool IncrementalMarking::CanBeActivated() {
#ifndef DEBUG
static const intptr_t kActivationThreshold = 8 * MB;
#else
@ -407,6 +407,7 @@ bool IncrementalMarking::WorthActivating() {
// Only start incremental marking in a safe state: 1) when incremental
// marking is turned on, 2) when we are currently not in a GC, and
// 3) when we are currently not serializing or deserializing the heap.
// Don't switch on for very small heaps.
return FLAG_incremental_marking && FLAG_incremental_marking_steps &&
heap_->gc_state() == Heap::NOT_IN_GC &&
heap_->deserialization_complete() &&
@ -814,7 +815,7 @@ void IncrementalMarking::Epilogue() {
void IncrementalMarking::OldSpaceStep(intptr_t allocated) {
if (IsStopped() && ShouldActivate()) {
if (IsStopped() && ShouldActivateEvenWithoutIdleNotification()) {
Start();
} else {
Step(allocated * kOldSpaceAllocationMarkingFactor, GC_VIA_STACK_GUARD);

View File

@ -64,9 +64,9 @@ class IncrementalMarking {
GCRequestType request_type() const { return request_type_; }
bool WorthActivating();
bool CanBeActivated();
bool ShouldActivate();
bool ShouldActivateEvenWithoutIdleNotification();
bool WasActivated();