Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Revert "Make sure that memory reducer makes progress in incremental m…
Browse files Browse the repository at this point in the history
…arking"

This reverts commit 1345f81.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#30329}
  • Loading branch information
mlippautz authored and Commit bot committed Aug 24, 2015
1 parent e8ce7ac commit b06a6a8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 41 deletions.
13 changes: 0 additions & 13 deletions src/heap/heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4622,19 +4622,6 @@ void Heap::ReduceNewSpaceSize() {
}


void Heap::FinalizeIncrementalMarkingIfComplete(const char* comment) {
if (FLAG_overapproximate_weak_closure &&
(incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
(!incremental_marking()->weak_closure_was_overapproximated() &&
mark_compact_collector_.marking_deque()->IsEmpty()))) {
OverApproximateWeakClosure(comment);
} else if (incremental_marking()->IsComplete() ||
(mark_compact_collector_.marking_deque()->IsEmpty())) {
CollectAllGarbage(current_gc_flags(), comment);
}
}


bool Heap::TryFinalizeIdleIncrementalMarking(
double idle_time_in_ms, size_t size_of_objects,
size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
Expand Down
4 changes: 0 additions & 4 deletions src/heap/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,6 @@ class Heap {
// Notify the heap that a context has been disposed.
int NotifyContextDisposed(bool dependant_context);

void FinalizeIncrementalMarkingIfComplete(const char* comment);

inline void increment_scan_on_scavenge_pages() {
scan_on_scavenge_pages_++;
if (FLAG_gc_verbose) {
Expand Down Expand Up @@ -1248,8 +1246,6 @@ class Heap {
bool HasHighFragmentation();
bool HasHighFragmentation(intptr_t used, intptr_t committed);

bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; }

// ===========================================================================
// Initialization. ===========================================================
// ===========================================================================
Expand Down
25 changes: 1 addition & 24 deletions src/heap/memory-reducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,12 @@ void MemoryReducer::NotifyTimer(const Event& event) {
if (state_.action == kRun) {
DCHECK(heap()->incremental_marking()->IsStopped());
DCHECK(FLAG_incremental_marking);
heap()->StartIdleIncrementalMarking();
if (FLAG_trace_gc_verbose) {
PrintIsolate(heap()->isolate(), "Memory reducer: started GC #%d\n",
state_.started_gcs);
}
if (heap()->ShouldOptimizeForMemoryUsage()) {
// Do full GC if memory usage has higher priority than latency. This is
// important for background tabs that do not send idle notifications.
heap()->CollectAllGarbage(Heap::kReduceMemoryFootprintMask,
"memory reducer");
} else {
heap()->StartIdleIncrementalMarking();
}
} else if (state_.action == kWait) {
if (!heap()->incremental_marking()->IsStopped() &&
heap()->ShouldOptimizeForMemoryUsage()) {
// Make progress with pending incremental marking if memory usage has
// higher priority than latency. This is important for background tabs
// that do not send idle notifications.
const int kIncrementalMarkingDelayMs = 500;
double deadline = heap()->MonotonicallyIncreasingTimeInMs() +
kIncrementalMarkingDelayMs;
heap()->AdvanceIncrementalMarking(
0, deadline, i::IncrementalMarking::StepActions(
i::IncrementalMarking::NO_GC_VIA_STACK_GUARD,
i::IncrementalMarking::FORCE_MARKING,
i::IncrementalMarking::FORCE_COMPLETION));
heap()->FinalizeIncrementalMarkingIfComplete(
"Memory reducer: finalize incremental marking");
}
// Re-schedule the timer.
ScheduleTimer(state_.next_gc_start_ms - event.time_ms);
if (FLAG_trace_gc_verbose) {
Expand Down

0 comments on commit b06a6a8

Please sign in to comment.