# HG changeset patch # User sjohanss # Date 1521111538 -3600 # Node ID 657893cb281bddbc02725524a5b8344e0c8dcf0c # Parent 7a656b77a2d832d32a200b09a95f9cb747f71380 8199674: Improve G1 Full GC array marking Reviewed-by: tschatzl, shade diff -r 7a656b77a2d8 -r 657893cb281b 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) {