Reviewers: Hablich,

Description:
Version 4.6.85.8 (cherry-pick)

Merged b06a6a891cc762835577bb856f8c5e8f0bf8ab31

Revert "Make sure that memory reducer makes progress in incremental marking"

[email protected]
BUG=chromium:519319

Please review this at https://codereview.chromium.org/1310093004/

Base URL: https://chromium.googlesource.com/v8/[email protected]

Affected files (+2, -42 lines):
  M include/v8-version.h
  M src/heap/heap.h
  M src/heap/heap.cc
  M src/heap/memory-reducer.cc


Index: include/v8-version.h
diff --git a/include/v8-version.h b/include/v8-version.h
index 7c38912c44db92e9151506f92779fd1308230c03..31f95cac7685280e13dc107bf6385289a53c78c3 100644
--- a/include/v8-version.h
+++ b/include/v8-version.h
@@ -11,7 +11,7 @@
 #define V8_MAJOR_VERSION 4
 #define V8_MINOR_VERSION 6
 #define V8_BUILD_NUMBER 85
-#define V8_PATCH_LEVEL 7
+#define V8_PATCH_LEVEL 8

 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 0da371e9d5ff85b85638c33275978f1bc422b839..516eaae047a2bb477f20fb67a5af5018adbe7c59 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4771,19 +4771,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(kNoGCFlags, 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) {
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index a4e3256e94c4fe6e7c94b10c856c5c7a808991cc..25b0f595de6f679143b445a3b44c7a6d38387233 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -864,8 +864,6 @@ class Heap {
       intptr_t step_size_in_bytes, double deadline_in_ms,
       IncrementalMarking::StepActions step_actions);

-  void FinalizeIncrementalMarkingIfComplete(const char* comment);
-
   inline void increment_scan_on_scavenge_pages() {
     scan_on_scavenge_pages_++;
     if (FLAG_gc_verbose) {
@@ -1603,8 +1601,6 @@ class Heap {
   bool HasHighFragmentation();
   bool HasHighFragmentation(intptr_t used, intptr_t committed);

- bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; }
-
  protected:
   // Methods made available to tests.

Index: src/heap/memory-reducer.cc
diff --git a/src/heap/memory-reducer.cc b/src/heap/memory-reducer.cc
index c297c4dde248a7fb498d6c39a74368b2444bbfa9..25378b59112a0584cb4f6e750f0719becd66170f 100644
--- a/src/heap/memory-reducer.cc
+++ b/src/heap/memory-reducer.cc
@@ -45,35 +45,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) {


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to