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