Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 929933002: Revert of Just visit young array buffers during scavenge. (Closed)

Created:
5 years, 10 months ago by Michael Achenbach
Modified:
5 years, 10 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Revert of Just visit young array buffers during scavenge. (patchset #8 id:140001 of https://codereview.chromium.org/904633003/) Reason for revert: Introduces crashes. Original issue's description: > Just visit young array buffers during scavenge. Additionally keep the views in new space in a separate global list and move them to the corresponding array buffers when they get promoted. > > This reduces young generation garbage collections when many array buffers are allocated. > BUG= > > Committed: https://crrev.com/bd61a85fafd6461a40dc1e20252fd843f148e837 > Cr-Commit-Position: refs/heads/master@{#26605} TBR=ulan@chromium.org,dslomov@chromium.org,kbr@chromium.org,hpayer@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -237 lines) Patch
M src/factory.cc View 1 chunk +2 lines, -8 lines 0 comments Download
M src/heap/heap.h View 5 chunks +3 lines, -26 lines 0 comments Download
M src/heap/heap.cc View 6 chunks +9 lines, -70 lines 0 comments Download
M src/heap/mark-compact.cc View 1 chunk +0 lines, -1 line 0 comments Download
M src/heap/objects-visiting.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/heap/objects-visiting.cc View 5 chunks +15 lines, -25 lines 0 comments Download
M src/objects.cc View 1 chunk +2 lines, -9 lines 0 comments Download
M src/runtime/runtime-typedarray.cc View 5 chunks +6 lines, -46 lines 0 comments Download
M src/serialize.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M test/cctest/test-weaktypedarrays.cc View 6 chunks +21 lines, -48 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
Michael Achenbach
Created Revert of Just visit young array buffers during scavenge.
5 years, 10 months ago (2015-02-16 07:22:10 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/929933002/1
5 years, 10 months ago (2015-02-16 07:22:46 UTC) #2
commit-bot: I haz the power
5 years, 10 months ago (2015-02-16 07:22:51 UTC) #4
Failed to apply patch for src/heap/heap.cc:
While running git apply --index -3 -p1;
  error: patch failed: src/heap/heap.cc:5604
  error: repository lacks the necessary blob to fall back on 3-way merge.
  error: src/heap/heap.cc: patch does not apply

Patch:       src/heap/heap.cc
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index
55a8b2d3c7f93efa27a470f2406201dc6a26143e..523b819a37fe4d7d038ba3a0be40e0825e6e4924
100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -144,8 +144,7 @@
       external_string_table_(this),
       chunks_queued_for_free_(NULL),
       gc_callbacks_depth_(0),
-      deserialization_complete_(false),
-      promotion_failure_(false) {
+      deserialization_complete_(false) {
 // Allow build-time customization of the max semispace size. Building
 // V8 with snapshots and a non-default max semispace size is much
 // easier if you can define it as part of the build environment.
@@ -732,7 +731,6 @@
   // Remember the last top pointer so that we can later find out
   // whether we allocated in new space since the last GC.
   new_space_top_after_last_gc_ = new_space()->top();
-  set_promotion_failure(false);
 }
 
 
@@ -1734,86 +1732,29 @@
 
 
 void Heap::ProcessAllWeakReferences(WeakObjectRetainer* retainer) {
-  ProcessArrayBuffers(retainer, false);
-  ProcessNewArrayBufferViews(retainer);
+  ProcessArrayBuffers(retainer);
   ProcessNativeContexts(retainer);
   ProcessAllocationSites(retainer);
 }
 
 
 void Heap::ProcessYoungWeakReferences(WeakObjectRetainer* retainer) {
-  ProcessArrayBuffers(retainer, true);
-  ProcessNewArrayBufferViews(retainer);
+  ProcessArrayBuffers(retainer);
   ProcessNativeContexts(retainer);
 }
 
 
 void Heap::ProcessNativeContexts(WeakObjectRetainer* retainer) {
-  Object* head =
-      VisitWeakList<Context>(this, native_contexts_list(), retainer, false);
+  Object* head = VisitWeakList<Context>(this, native_contexts_list(),
retainer);
   // Update the head of the list of contexts.
   set_native_contexts_list(head);
 }
 
 
-void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer,
-                               bool stop_after_young) {
-  Object* array_buffer_obj = VisitWeakList<JSArrayBuffer>(
-      this, array_buffers_list(), retainer, stop_after_young);
+void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer) {
+  Object* array_buffer_obj =
+      VisitWeakList<JSArrayBuffer>(this, array_buffers_list(), retainer);
   set_array_buffers_list(array_buffer_obj);
-
-#ifdef DEBUG
-  // Verify invariant that young array buffers come before old array buffers
-  // in array buffers list if there was no promotion failure.
-  Object* undefined = undefined_value();
-  Object* next = array_buffers_list();
-  bool old_objects_recorded = false;
-  if (promotion_failure()) return;
-  while (next != undefined) {
-    if (!old_objects_recorded) {
-      old_objects_recorded = !InNewSpace(next);
-    }
-    DCHECK((InNewSpace(next) && !old_objects_recorded) || !InNewSpace(next));
-    next = JSArrayBuffer::cast(next)->weak_next();
-  }
-#endif
-}
-
-
-void Heap::ProcessNewArrayBufferViews(WeakObjectRetainer* retainer) {
-  // Retain the list of new space views.
-  Object* typed_array_obj = VisitWeakList<JSArrayBufferView>(
-      this, new_array_buffer_views_list_, retainer, false);
-  set_new_array_buffer_views_list(typed_array_obj);
-
-  // Some objects in the list may be in old space now. Find them
-  // and move them to the corresponding array buffer.
-  Object* undefined = undefined_value();
-  Object* previous = undefined;
-  Object* head = undefined;
-  Object* next;
-  for (Object* o = new_array_buffer_views_list(); o != undefined;) {
-    JSArrayBufferView* view = JSArrayBufferView::cast(o);
-    next = view->weak_next();
-    if (!InNewSpace(view)) {
-      if (previous != undefined) {
-        // We are in the middle of the list, skip the old space element.
-        JSArrayBufferView::cast(previous)->set_weak_next(next);
-      }
-      JSArrayBuffer* buffer = JSArrayBuffer::cast(view->buffer());
-      view->set_weak_next(buffer->weak_first_view());
-      buffer->set_weak_first_view(view);
-    } else {
-      // We found a valid new space view, remember it.
-      previous = view;
-      if (head == undefined) {
-        // We are at the list head.
-        head = view;
-      }
-    }
-    o = next;
-  }
-  set_new_array_buffer_views_list(head);
 }
 
 
@@ -1829,8 +1770,8 @@
 
 
 void Heap::ProcessAllocationSites(WeakObjectRetainer* retainer) {
-  Object* allocation_site_obj = VisitWeakList<AllocationSite>(
-      this, allocation_sites_list(), retainer, false);
+  Object* allocation_site_obj =
+      VisitWeakList<AllocationSite>(this, allocation_sites_list(), retainer);
   set_allocation_sites_list(allocation_site_obj);
 }
 
@@ -2263,7 +2204,6 @@
       return;
     }
 
-    heap->set_promotion_failure(true);
     // If promotion failed, we try to copy the object to the other semi-space
     if (SemiSpaceCopyObject<alignment>(map, slot, object, object_size)) return;
 
@@ -5604,7 +5544,6 @@
 
   set_native_contexts_list(undefined_value());
   set_array_buffers_list(undefined_value());
-  set_new_array_buffer_views_list(undefined_value());
   set_allocation_sites_list(undefined_value());
   weak_object_to_code_table_ = undefined_value();
   return true;

Powered by Google App Engine
This is Rietveld 408576698