src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp
changeset 55654 92ab031d6540
parent 55158 d3e404cc3972
child 55679 aa96c53c592b
--- a/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp	Thu Jul 11 06:56:51 2019 +0200
+++ b/src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp	Thu Jul 04 17:31:03 2019 +0200
@@ -27,6 +27,7 @@
 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
 #include "gc/shenandoah/shenandoahHeap.hpp"
 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
+#include "gc/shenandoah/shenandoahRuntime.hpp"
 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
 
@@ -183,7 +184,21 @@
     return;
   }
 
-  LIRGenerator *gen = access.gen();
+  LIRGenerator* gen = access.gen();
+
+  DecoratorSet decorators = access.decorators();
+  if ((decorators & IN_NATIVE) != 0) {
+    assert(access.is_oop(), "IN_NATIVE access only for oop values");
+    BarrierSetC1::load_at_resolved(access, result);
+    LIR_OprList* args = new LIR_OprList();
+    args->append(result);
+    BasicTypeList signature;
+    signature.append(T_OBJECT);
+    LIR_Opr call_result = gen->call_runtime(&signature, args, CAST_FROM_FN_PTR(address, ShenandoahRuntime::oop_load_from_native_barrier),
+                                            objectType, NULL);
+    __ move(call_result, result);
+    return;
+  }
 
   if (ShenandoahLoadRefBarrier) {
     LIR_Opr tmp = gen->new_register(T_OBJECT);
@@ -195,7 +210,6 @@
   }
 
   if (ShenandoahKeepAliveBarrier) {
-    DecoratorSet decorators = access.decorators();
     bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0;
     bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
     bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
@@ -229,3 +243,10 @@
                                                               "shenandoah_pre_barrier_slow",
                                                               false, &pre_code_gen_cl);
 }
+
+const char* ShenandoahBarrierSetC1::rtcall_name_for_address(address entry) {
+  if (entry == CAST_FROM_FN_PTR(address, ShenandoahRuntime::oop_load_from_native_barrier)) {
+    return "ShenandoahRuntime::oop_load_from_native_barrier";
+  }
+  return NULL;
+}