src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.cpp
changeset 55654 92ab031d6540
parent 55158 d3e404cc3972
child 55679 aa96c53c592b
equal deleted inserted replaced
55653:3243c42d737d 55654:92ab031d6540
    25 #include "c1/c1_IR.hpp"
    25 #include "c1/c1_IR.hpp"
    26 #include "gc/shared/satbMarkQueue.hpp"
    26 #include "gc/shared/satbMarkQueue.hpp"
    27 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
    27 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
    28 #include "gc/shenandoah/shenandoahHeap.hpp"
    28 #include "gc/shenandoah/shenandoahHeap.hpp"
    29 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
    29 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
       
    30 #include "gc/shenandoah/shenandoahRuntime.hpp"
    30 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
    31 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
    31 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
    32 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
    32 
    33 
    33 #ifdef ASSERT
    34 #ifdef ASSERT
    34 #define __ gen->lir(__FILE__, __LINE__)->
    35 #define __ gen->lir(__FILE__, __LINE__)->
   181   if (!access.is_oop()) {
   182   if (!access.is_oop()) {
   182     BarrierSetC1::load_at_resolved(access, result);
   183     BarrierSetC1::load_at_resolved(access, result);
   183     return;
   184     return;
   184   }
   185   }
   185 
   186 
   186   LIRGenerator *gen = access.gen();
   187   LIRGenerator* gen = access.gen();
       
   188 
       
   189   DecoratorSet decorators = access.decorators();
       
   190   if ((decorators & IN_NATIVE) != 0) {
       
   191     assert(access.is_oop(), "IN_NATIVE access only for oop values");
       
   192     BarrierSetC1::load_at_resolved(access, result);
       
   193     LIR_OprList* args = new LIR_OprList();
       
   194     args->append(result);
       
   195     BasicTypeList signature;
       
   196     signature.append(T_OBJECT);
       
   197     LIR_Opr call_result = gen->call_runtime(&signature, args, CAST_FROM_FN_PTR(address, ShenandoahRuntime::oop_load_from_native_barrier),
       
   198                                             objectType, NULL);
       
   199     __ move(call_result, result);
       
   200     return;
       
   201   }
   187 
   202 
   188   if (ShenandoahLoadRefBarrier) {
   203   if (ShenandoahLoadRefBarrier) {
   189     LIR_Opr tmp = gen->new_register(T_OBJECT);
   204     LIR_Opr tmp = gen->new_register(T_OBJECT);
   190     BarrierSetC1::load_at_resolved(access, tmp);
   205     BarrierSetC1::load_at_resolved(access, tmp);
   191     tmp = load_reference_barrier(access.gen(), tmp, access.access_emit_info(), true);
   206     tmp = load_reference_barrier(access.gen(), tmp, access.access_emit_info(), true);
   193   } else {
   208   } else {
   194     BarrierSetC1::load_at_resolved(access, result);
   209     BarrierSetC1::load_at_resolved(access, result);
   195   }
   210   }
   196 
   211 
   197   if (ShenandoahKeepAliveBarrier) {
   212   if (ShenandoahKeepAliveBarrier) {
   198     DecoratorSet decorators = access.decorators();
       
   199     bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0;
   213     bool is_weak = (decorators & ON_WEAK_OOP_REF) != 0;
   200     bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
   214     bool is_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
   201     bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
   215     bool is_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0;
   202     if (is_weak || is_phantom || is_anonymous) {
   216     if (is_weak || is_phantom || is_anonymous) {
   203       // Register the value in the referent field with the pre-barrier
   217       // Register the value in the referent field with the pre-barrier
   227   C1ShenandoahPreBarrierCodeGenClosure pre_code_gen_cl;
   241   C1ShenandoahPreBarrierCodeGenClosure pre_code_gen_cl;
   228   _pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1,
   242   _pre_barrier_c1_runtime_code_blob = Runtime1::generate_blob(buffer_blob, -1,
   229                                                               "shenandoah_pre_barrier_slow",
   243                                                               "shenandoah_pre_barrier_slow",
   230                                                               false, &pre_code_gen_cl);
   244                                                               false, &pre_code_gen_cl);
   231 }
   245 }
       
   246 
       
   247 const char* ShenandoahBarrierSetC1::rtcall_name_for_address(address entry) {
       
   248   if (entry == CAST_FROM_FN_PTR(address, ShenandoahRuntime::oop_load_from_native_barrier)) {
       
   249     return "ShenandoahRuntime::oop_load_from_native_barrier";
       
   250   }
       
   251   return NULL;
       
   252 }