src/hotspot/cpu/sparc/c1_CodeStubs_sparc.cpp
changeset 49906 4bb58f644e4e
parent 49347 edb65305d3ac
child 50094 2f79462aab9b
equal deleted inserted replaced
49905:a09af8ef8e5c 49906:4bb58f644e4e
    30 #include "c1/c1_Runtime1.hpp"
    30 #include "c1/c1_Runtime1.hpp"
    31 #include "nativeInst_sparc.hpp"
    31 #include "nativeInst_sparc.hpp"
    32 #include "runtime/sharedRuntime.hpp"
    32 #include "runtime/sharedRuntime.hpp"
    33 #include "utilities/macros.hpp"
    33 #include "utilities/macros.hpp"
    34 #include "vmreg_sparc.inline.hpp"
    34 #include "vmreg_sparc.inline.hpp"
    35 #if INCLUDE_ALL_GCS
       
    36 #include "gc/g1/g1BarrierSet.hpp"
       
    37 #endif // INCLUDE_ALL_GCS
       
    38 
    35 
    39 #define __ ce->masm()->
    36 #define __ ce->masm()->
    40 
    37 
    41 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
    38 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
    42                                bool throw_index_out_of_bounds_exception)
    39                                bool throw_index_out_of_bounds_exception)
   452 
   449 
   453   __ br(Assembler::always, false, Assembler::pt, _continuation);
   450   __ br(Assembler::always, false, Assembler::pt, _continuation);
   454   __ delayed()->nop();
   451   __ delayed()->nop();
   455 }
   452 }
   456 
   453 
   457 
       
   458 ///////////////////////////////////////////////////////////////////////////////////
       
   459 #if INCLUDE_ALL_GCS
       
   460 
       
   461 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
       
   462   // At this point we know that marking is in progress.
       
   463   // If do_load() is true then we have to emit the
       
   464   // load of the previous value; otherwise it has already
       
   465   // been loaded into _pre_val.
       
   466 
       
   467   __ bind(_entry);
       
   468 
       
   469   assert(pre_val()->is_register(), "Precondition.");
       
   470   Register pre_val_reg = pre_val()->as_register();
       
   471 
       
   472   if (do_load()) {
       
   473     ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
       
   474   }
       
   475 
       
   476   if (__ is_in_wdisp16_range(_continuation)) {
       
   477     __ br_null(pre_val_reg, /*annul*/false, Assembler::pt, _continuation);
       
   478   } else {
       
   479     __ cmp(pre_val_reg, G0);
       
   480     __ brx(Assembler::equal, false, Assembler::pn, _continuation);
       
   481   }
       
   482   __ delayed()->nop();
       
   483 
       
   484   __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id));
       
   485   __ delayed()->mov(pre_val_reg, G4);
       
   486   __ br(Assembler::always, false, Assembler::pt, _continuation);
       
   487   __ delayed()->nop();
       
   488 
       
   489 }
       
   490 
       
   491 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
       
   492   __ bind(_entry);
       
   493 
       
   494   assert(addr()->is_register(), "Precondition.");
       
   495   assert(new_val()->is_register(), "Precondition.");
       
   496   Register addr_reg = addr()->as_pointer_register();
       
   497   Register new_val_reg = new_val()->as_register();
       
   498 
       
   499   if (__ is_in_wdisp16_range(_continuation)) {
       
   500     __ br_null(new_val_reg, /*annul*/false, Assembler::pt, _continuation);
       
   501   } else {
       
   502     __ cmp(new_val_reg, G0);
       
   503     __ brx(Assembler::equal, false, Assembler::pn, _continuation);
       
   504   }
       
   505   __ delayed()->nop();
       
   506 
       
   507   __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_post_barrier_slow_id));
       
   508   __ delayed()->mov(addr_reg, G4);
       
   509   __ br(Assembler::always, false, Assembler::pt, _continuation);
       
   510   __ delayed()->nop();
       
   511 }
       
   512 
       
   513 #endif // INCLUDE_ALL_GCS
       
   514 ///////////////////////////////////////////////////////////////////////////////////
       
   515 
       
   516 #undef __
   454 #undef __