8232674: Fix build and rename ShenandoahBarrierSet::oop_load_from_native_barrier
authorshade
Mon, 21 Oct 2019 15:11:42 +0200
changeset 58710 ff3eab78554f
parent 58709 662d9e1e2a60
child 58711 765ecbffe88a
8232674: Fix build and rename ShenandoahBarrierSet::oop_load_from_native_barrier Reviewed-by: zgu
src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp
src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp
src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp
src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Mon Oct 21 09:58:32 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp	Mon Oct 21 15:11:42 2019 +0200
@@ -1033,7 +1033,7 @@
 
   address calladdr = is_native ? CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_native)
                                : target;
-  const char* name = is_native ? "oop_load_from_native_barrier" : "load_reference_barrier";
+  const char* name = is_native ? "load_reference_barrier_native" : "load_reference_barrier";
   Node* call = new CallLeafNode(ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type(), calladdr, name, TypeRawPtr::BOTTOM);
 
   call->init_req(TypeFunc::Control, ctrl);
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp	Mon Oct 21 09:58:32 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp	Mon Oct 21 15:11:42 2019 +0200
@@ -262,7 +262,18 @@
   }
 }
 
-oop ShenandoahBarrierSet::oop_load_from_native_barrier(oop obj, oop* load_addr) {
+oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, oop* load_addr) {
+  return load_reference_barrier_native_impl(obj, load_addr);
+}
+
+oop ShenandoahBarrierSet::load_reference_barrier_native(oop obj, narrowOop* load_addr) {
+  // Assumption: narrow oop version should not be used anywhere.
+  ShouldNotReachHere();
+  return NULL;
+}
+
+template <class T>
+oop ShenandoahBarrierSet::load_reference_barrier_native_impl(oop obj, T* load_addr) {
   if (CompressedOops::is_null(obj)) {
     return NULL;
   }
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Mon Oct 21 09:58:32 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.hpp	Mon Oct 21 15:11:42 2019 +0200
@@ -84,10 +84,6 @@
 
   void write_ref_field_work(void* v, oop o, bool release = false);
 
-  oop oop_load_from_native_barrier(oop obj, oop* load_addr);
-  oop oop_load_from_native_barrier(oop obj, narrowOop* load_addr);
-
-
   virtual void on_thread_create(Thread* thread);
   virtual void on_thread_destroy(Thread* thread);
   virtual void on_thread_attach(Thread* thread);
@@ -108,6 +104,9 @@
   template <class T>
   oop load_reference_barrier_mutator_work(oop obj, T* load_addr);
 
+  oop load_reference_barrier_native(oop obj, oop* load_addr);
+  oop load_reference_barrier_native(oop obj, narrowOop* load_addr);
+
   void enqueue(oop obj);
 
 private:
@@ -120,6 +119,9 @@
 
   oop load_reference_barrier_impl(oop obj);
 
+  template <class T>
+  oop load_reference_barrier_native_impl(oop obj, T* load_addr);
+
   static void keep_alive_if_weak(DecoratorSet decorators, oop value) {
     assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Reference strength must be known");
     const bool on_strong_oop_ref = (decorators & ON_STRONG_OOP_REF) != 0;
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Mon Oct 21 09:58:32 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp	Mon Oct 21 15:11:42 2019 +0200
@@ -69,7 +69,7 @@
 template <typename T>
 inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_load_not_in_heap(T* addr) {
   oop value = Raw::oop_load_not_in_heap(addr);
-  value = ShenandoahBarrierSet::barrier_set()->oop_load_from_native_barrier(value, addr);
+  value = ShenandoahBarrierSet::barrier_set()->load_reference_barrier_native(value, addr);
   keep_alive_if_weak(decorators, value);
   return value;
 }
--- a/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp	Mon Oct 21 09:58:32 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp	Mon Oct 21 15:11:42 2019 +0200
@@ -83,5 +83,5 @@
 JRT_END
 
 JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_native(oopDesc * src, oop* load_addr))
-  return (oopDesc*) ShenandoahBarrierSet::barrier_set()->oop_load_from_native_barrier(oop(src), load_addr);
+  return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier_native(oop(src), load_addr);
 JRT_END