Reviewers: jochen (ooo),

Message:
Jochen: The change to force a synchronously processing phantom callbacks had the side effect of forcing GCs in blink, adding up to the atomic pause in V8's full
GC.

smoothness.image_decoding_cases still ok on N9 with this change.

Hannes: Rips off ~6-9ms accounted to external from the full GC pauses in oort.


https://codereview.chromium.org/1287323002/diff/1/include/v8.h
File include/v8.h (left):

https://codereview.chromium.org/1287323002/diff/1/include/v8.h#oldcode4968
include/v8.h:4968: kGCCallbackFlagCompacted = 1 << 0,
Can we remove this unused flag?

Description:
[api] Do not force external GCs when only trying to synchronously process
phantom callbacks

Improves on aec8987b5ee55fa46b90b58927e957a4e5f19c09 by not forcing external GCs
(blink) through the GC epilogue callback.

BUG=chromium:515795

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+10, -7 lines):
  M include/v8.h
  M src/api.cc
  M src/global-handles.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 71a1805aafc93b4fe0da8b2b0e3151cb61b59eb1..fc3381042a7c42cfb1c623db136a033adf6af6d8 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4965,9 +4965,9 @@ enum GCType {

 enum GCCallbackFlags {
   kNoGCCallbackFlags = 0,
-  kGCCallbackFlagCompacted = 1 << 0,
   kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1,
-  kGCCallbackFlagForced = 1 << 2
+  kGCCallbackFlagForced = 1 << 2,
+  kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3
 };

 typedef void (*GCPrologueCallback)(GCType type, GCCallbackFlags flags);
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 4f98293556bbd8d3eca3a15c2361c135477334f2..5bb56e6e722af5b415335642e86992229bc90230 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -6882,11 +6882,13 @@ void Isolate::CollectAllGarbage(const char* gc_reason) {
   i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
   if (heap->incremental_marking()->IsStopped()) {
     if (heap->incremental_marking()->CanBeActivated()) {
- heap->StartIncrementalMarking(i::Heap::kNoGCFlags, kGCCallbackFlagForced,
-                                    gc_reason);
+      heap->StartIncrementalMarking(
+          i::Heap::kNoGCFlags,
+          kGCCallbackFlagSynchronousPhantomCallbackProcessing, gc_reason);
     } else {
-      heap->CollectAllGarbage(i::Heap::kNoGCFlags, gc_reason,
-                              kGCCallbackFlagForced);
+      heap->CollectAllGarbage(
+          i::Heap::kNoGCFlags, gc_reason,
+          kGCCallbackFlagSynchronousPhantomCallbackProcessing);
     }
   } else {
     // Incremental marking is turned on an has already been started.
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 444614c166c0a0203e8af2b530215efecbcc54cf..4b57a8925256826273db981d7bcca48a8f362be8 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -883,7 +883,8 @@ int GlobalHandles::PostGarbageCollectionProcessing(
   const int initial_post_gc_processing_count = ++post_gc_processing_count_;
   int freed_nodes = 0;
   bool synchronous_second_pass =
-      (gc_callback_flags & kGCCallbackFlagForced) != 0;
+      (gc_callback_flags &
+       kGCCallbackFlagSynchronousPhantomCallbackProcessing) != 0;
   freed_nodes += DispatchPendingPhantomCallbacks(synchronous_second_pass);
   if (initial_post_gc_processing_count != post_gc_processing_count_) {
     // If the callbacks caused a nested GC, then return.  See comment in


--
--
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