8199674: Improve G1 Full GC array marking
authorsjohanss
Thu, 15 Mar 2018 11:58:58 +0100
changeset 49447 657893cb281b
parent 49411 7a656b77a2d8
child 49448 b91b558a9076
8199674: Improve G1 Full GC array marking Reviewed-by: tschatzl, shade
src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp
--- a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp	Tue Mar 13 15:13:20 2018 -0700
+++ b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp	Thu Mar 15 11:58:58 2018 +0100
@@ -107,6 +107,11 @@
   const int stride = MIN2(len - beg_index, (int) ObjArrayMarkingStride);
   const int end_index = beg_index + stride;
 
+  // Push the continuation first to allow more efficient work stealing.
+  if (end_index < len) {
+    push_objarray(array, end_index);
+  }
+
   array->oop_iterate_range(mark_closure(), beg_index, end_index);
 
   if (VerifyDuringGC) {
@@ -117,10 +122,6 @@
       assert(false, "Failed");
     }
   }
-
-  if (end_index < len) {
-    push_objarray(array, end_index); // Push the continuation.
-  }
 }
 
 inline void G1FullGCMarker::follow_object(oop obj) {