From 337673528e76e17e3a76ca84b76fb0d1e7fb5ec0 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Thu, 15 Mar 2018 11:58:58 +0100 Subject: [PATCH] 8199674: Improve G1 Full GC array marking Reviewed-by: tschatzl, shade --- src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp index b01269e8764..0894f11f3dd 100644 --- a/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp +++ b/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp @@ -107,6 +107,11 @@ void G1FullGCMarker::follow_array_chunk(objArrayOop array, int index) { 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 @@ void G1FullGCMarker::follow_array_chunk(objArrayOop array, int index) { assert(false, "Failed"); } } - - if (end_index < len) { - push_objarray(array, end_index); // Push the continuation. - } } inline void G1FullGCMarker::follow_object(oop obj) {