31 #include "c1/c1_Runtime1.hpp" |
31 #include "c1/c1_Runtime1.hpp" |
32 #include "nativeInst_ppc.hpp" |
32 #include "nativeInst_ppc.hpp" |
33 #include "runtime/sharedRuntime.hpp" |
33 #include "runtime/sharedRuntime.hpp" |
34 #include "utilities/macros.hpp" |
34 #include "utilities/macros.hpp" |
35 #include "vmreg_ppc.inline.hpp" |
35 #include "vmreg_ppc.inline.hpp" |
36 #if INCLUDE_ALL_GCS |
|
37 #include "gc/g1/g1BarrierSet.hpp" |
|
38 #endif // INCLUDE_ALL_GCS |
|
39 |
36 |
40 #define __ ce->masm()-> |
37 #define __ ce->masm()-> |
41 |
38 |
42 |
39 |
43 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, |
40 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, |
468 #endif |
465 #endif |
469 |
466 |
470 __ b(_continuation); |
467 __ b(_continuation); |
471 } |
468 } |
472 |
469 |
473 |
|
474 /////////////////////////////////////////////////////////////////////////////////// |
|
475 #if INCLUDE_ALL_GCS |
|
476 |
|
477 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) { |
|
478 // At this point we know that marking is in progress. |
|
479 // If do_load() is true then we have to emit the |
|
480 // load of the previous value; otherwise it has already |
|
481 // been loaded into _pre_val. |
|
482 |
|
483 __ bind(_entry); |
|
484 |
|
485 assert(pre_val()->is_register(), "Precondition."); |
|
486 Register pre_val_reg = pre_val()->as_register(); |
|
487 |
|
488 if (do_load()) { |
|
489 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/); |
|
490 } |
|
491 |
|
492 __ cmpdi(CCR0, pre_val_reg, 0); |
|
493 __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), _continuation); |
|
494 |
|
495 address stub = Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id); |
|
496 //__ load_const_optimized(R0, stub); |
|
497 __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); |
|
498 __ std(pre_val_reg, -8, R1_SP); // Pass pre_val on stack. |
|
499 __ mtctr(R0); |
|
500 __ bctrl(); |
|
501 __ b(_continuation); |
|
502 } |
|
503 |
|
504 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) { |
|
505 __ bind(_entry); |
|
506 |
|
507 assert(addr()->is_register(), "Precondition."); |
|
508 assert(new_val()->is_register(), "Precondition."); |
|
509 Register addr_reg = addr()->as_pointer_register(); |
|
510 Register new_val_reg = new_val()->as_register(); |
|
511 |
|
512 __ cmpdi(CCR0, new_val_reg, 0); |
|
513 __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), _continuation); |
|
514 |
|
515 address stub = Runtime1::entry_for(Runtime1::Runtime1::g1_post_barrier_slow_id); |
|
516 //__ load_const_optimized(R0, stub); |
|
517 __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); |
|
518 __ mtctr(R0); |
|
519 __ mr(R0, addr_reg); // Pass addr in R0. |
|
520 __ bctrl(); |
|
521 __ b(_continuation); |
|
522 } |
|
523 |
|
524 #endif // INCLUDE_ALL_GCS |
|
525 /////////////////////////////////////////////////////////////////////////////////// |
|
526 |
|
527 #undef __ |
470 #undef __ |