changeset 12366:0991c12c4186

Defer barriers upon slow-path allocation
author Christos Kotselidis <christos.kotselidis@oracle.com>
date Fri, 11 Oct 2013 17:08:22 +0200
parents ee746f35ae17
children c4af81d4fcc3
files src/share/vm/graal/graalRuntime.cpp
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.