src/hotspot/share/jvmci/jvmciRuntime.cpp
changeset 48961 120b61d50f85
parent 48105 8d15b1369c7a
child 49192 6734eeef4283
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp	Mon Feb 12 16:08:33 2018 -0800
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp	Wed Jan 10 22:48:27 2018 +0100
@@ -116,10 +116,7 @@
   oop obj = ik->allocate_instance(CHECK);
   thread->set_vm_result(obj);
   JRT_BLOCK_END;
-
-  if (ReduceInitialCardMarks) {
-    new_store_pre_barrier(thread);
-  }
+  SharedRuntime::on_slowpath_allocation_exit(thread);
 JRT_END
 
 JRT_BLOCK_ENTRY(void, JVMCIRuntime::new_array(JavaThread* thread, Klass* array_klass, jint length))
@@ -151,29 +148,9 @@
     }
   }
   JRT_BLOCK_END;
-
-  if (ReduceInitialCardMarks) {
-    new_store_pre_barrier(thread);
-  }
+  SharedRuntime::on_slowpath_allocation_exit(thread);
 JRT_END
 
-void JVMCIRuntime::new_store_pre_barrier(JavaThread* thread) {
-  // After any safepoint, just before going back to compiled code,
-  // we inform the GC that we will be doing initializing writes to
-  // this object in the future without emitting card-marks, so
-  // GC may take any compensating steps.
-  // NOTE: Keep this code consistent with GraphKit::store_barrier.
-
-  oop new_obj = thread->vm_result();
-  if (new_obj == NULL)  return;
-
-  assert(Universe::heap()->can_elide_tlab_store_barriers(),
-         "compiler must check this first");
-  // GC may decide to give back a safer copy of new_obj.
-  new_obj = Universe::heap()->new_store_pre_barrier(thread, new_obj);
-  thread->set_vm_result(new_obj);
-}
-
 JRT_ENTRY(void, JVMCIRuntime::new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims))
   assert(klass->is_klass(), "not a class");
   assert(rank >= 1, "rank must be nonzero");