--- old/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp 2018-06-18 18:34:29.900479017 +0200 +++ new/src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp 2018-06-18 18:34:29.724481012 +0200 @@ -27,6 +27,7 @@ #include "gc/shenandoah/shenandoahConnectionMatrix.hpp" #include "gc/shenandoah/shenandoahHeap.hpp" #include "gc/shenandoah/shenandoahHeapRegion.hpp" +#include "gc/shenandoah/shenandoahHeuristics.hpp" #include "gc/shenandoah/shenandoahRuntime.hpp" #include "gc/shenandoah/shenandoahThreadLocalData.hpp" #include "interpreter/interpreter.hpp" @@ -48,6 +49,11 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) { + if (ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) { + // Don't need arraycopy-pre-barrier for traversal. No need to pointlessly + // call out to runtime. + return; + } bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0; bool disjoint = (decorators & ARRAYCOPY_DISJOINT) != 0; bool obj_int = type == T_OBJECT LP64_ONLY(&& UseCompressedOops);