# HG changeset patch # User Christos Kotselidis # Date 1381504102 -7200 # Node ID 0991c12c4186e8c45d2df7f59ba94b1c9ebdf767 # Parent ee746f35ae1707ab119504098dc434f38d416ffa Defer barriers upon slow-path allocation diff -r ee746f35ae17 -r 0991c12c4186 src/share/vm/graal/graalRuntime.cpp --- a/src/share/vm/graal/graalRuntime.cpp Fri Oct 11 17:07:41 2013 +0200 +++ b/src/share/vm/graal/graalRuntime.cpp Fri Oct 11 17:08:22 2013 +0200 @@ -64,6 +64,9 @@ h->initialize(CHECK); // allocate instance and return via TLS oop obj = h->allocate_instance(CHECK); + if (GraalDeferredInitBarriers) { + obj = Universe::heap()->new_store_pre_barrier(thread, obj); + } thread->set_vm_result(obj); JRT_END @@ -80,6 +83,9 @@ Klass* elem_klass = ObjArrayKlass::cast(array_klass)->element_klass(); obj = oopFactory::new_objArray(elem_klass, length, CHECK); } + if (GraalDeferredInitBarriers) { + obj = Universe::heap()->new_store_pre_barrier(thread, obj); + } thread->set_vm_result(obj); // This is pretty rare but this runtime patch is stressful to deoptimization // if we deoptimize here so force a deopt to stress the path.