< prev index next >

src/hotspot/cpu/ppc/c1_Runtime1_ppc.cpp

Print this page




  28 #include "c1/c1_MacroAssembler.hpp"
  29 #include "c1/c1_Runtime1.hpp"
  30 #include "ci/ciUtilities.hpp"
  31 #include "gc/shared/cardTable.hpp"
  32 #include "gc/shared/cardTableBarrierSet.hpp"
  33 #include "interpreter/interpreter.hpp"
  34 #include "nativeInst_ppc.hpp"
  35 #include "oops/compiledICHolder.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "prims/jvmtiExport.hpp"
  38 #include "register_ppc.hpp"
  39 #include "runtime/sharedRuntime.hpp"
  40 #include "runtime/signature.hpp"
  41 #include "runtime/vframeArray.hpp"
  42 #include "utilities/align.hpp"
  43 #include "utilities/macros.hpp"
  44 #include "vmreg_ppc.inline.hpp"
  45 #if INCLUDE_ALL_GCS
  46 #include "gc/g1/g1BarrierSet.hpp"
  47 #include "gc/g1/g1CardTable.hpp"

  48 #endif
  49 
  50 // Implementation of StubAssembler
  51 
  52 int StubAssembler::call_RT(Register oop_result1, Register metadata_result,
  53                            address entry_point, int number_of_arguments) {
  54   set_num_rt_args(0); // Nothing on stack
  55   assert(!(oop_result1->is_valid() || metadata_result->is_valid()) ||
  56          oop_result1 != metadata_result, "registers must be different");
  57 
  58   // Currently no stack banging. We assume that there are enough
  59   // StackShadowPages (which have been banged in generate_stack_overflow_check)
  60   // for the stub frame and the runtime frames.
  61 
  62   set_last_Java_frame(R1_SP, noreg);
  63 
  64   // ARG1 must hold thread address.
  65   mr(R3_ARG1, R16_thread);
  66 
  67   address return_pc = call_c_with_frame_resize(entry_point, /*No resize, we have a C compatible frame.*/0);


 707       }
 708       break;
 709 
 710 #if INCLUDE_ALL_GCS
 711     case g1_pre_barrier_slow_id:
 712       {
 713         BarrierSet* bs = Universe::heap()->barrier_set();
 714         if (bs->kind() != BarrierSet::G1BarrierSet) {
 715           goto unimplemented_entry;
 716         }
 717 
 718         __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);
 719 
 720         // Using stack slots: pre_val (pre-pushed), spill tmp, spill tmp2.
 721         const int stack_slots = 3;
 722         Register pre_val = R0; // previous value of memory
 723         Register tmp  = R14;
 724         Register tmp2 = R15;
 725 
 726         Label refill, restart, marking_not_active;
 727         int satb_q_active_byte_offset =
 728           in_bytes(JavaThread::satb_mark_queue_offset() +
 729                    SATBMarkQueue::byte_offset_of_active());
 730         int satb_q_index_byte_offset =
 731           in_bytes(JavaThread::satb_mark_queue_offset() +
 732                    SATBMarkQueue::byte_offset_of_index());
 733         int satb_q_buf_byte_offset =
 734           in_bytes(JavaThread::satb_mark_queue_offset() +
 735                    SATBMarkQueue::byte_offset_of_buf());
 736 
 737         // Spill
 738         __ std(tmp, -16, R1_SP);
 739         __ std(tmp2, -24, R1_SP);
 740 
 741         // Is marking still active?
 742         if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
 743           __ lwz(tmp, satb_q_active_byte_offset, R16_thread);
 744         } else {
 745           assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
 746           __ lbz(tmp, satb_q_active_byte_offset, R16_thread);
 747         }
 748         __ cmpdi(CCR0, tmp, 0);
 749         __ beq(CCR0, marking_not_active);
 750 
 751         __ bind(restart);
 752         // Load the index into the SATB buffer. SATBMarkQueue::_index is a
 753         // size_t so ld_ptr is appropriate.
 754         __ ld(tmp, satb_q_index_byte_offset, R16_thread);
 755 


 812         __ add(addr, tmp2, addr);
 813         __ lbz(tmp, 0, addr); // tmp := [addr + cardtable]
 814 
 815         // Return if young card.
 816         __ cmpwi(CCR0, tmp, G1CardTable::g1_young_card_val());
 817         __ beq(CCR0, ret);
 818 
 819         // Return if sequential consistent value is already dirty.
 820         __ membar(Assembler::StoreLoad);
 821         __ lbz(tmp, 0, addr); // tmp := [addr + cardtable]
 822 
 823         __ cmpwi(CCR0, tmp, G1CardTable::dirty_card_val());
 824         __ beq(CCR0, ret);
 825 
 826         // Not dirty.
 827 
 828         // First, dirty it.
 829         __ li(tmp, G1CardTable::dirty_card_val());
 830         __ stb(tmp, 0, addr);
 831 
 832         int dirty_card_q_index_byte_offset =
 833           in_bytes(JavaThread::dirty_card_queue_offset() +
 834                    DirtyCardQueue::byte_offset_of_index());
 835         int dirty_card_q_buf_byte_offset =
 836           in_bytes(JavaThread::dirty_card_queue_offset() +
 837                    DirtyCardQueue::byte_offset_of_buf());
 838 
 839         __ bind(restart);
 840 
 841         // Get the index into the update buffer. DirtyCardQueue::_index is
 842         // a size_t so ld_ptr is appropriate here.
 843         __ ld(tmp2, dirty_card_q_index_byte_offset, R16_thread);
 844 
 845         // index == 0?
 846         __ cmpdi(CCR0, tmp2, 0);
 847         __ beq(CCR0, refill);
 848 
 849         __ ld(tmp, dirty_card_q_buf_byte_offset, R16_thread);
 850         __ addi(tmp2, tmp2, -oopSize);
 851 
 852         __ std(tmp2, dirty_card_q_index_byte_offset, R16_thread);
 853         __ add(tmp2, tmp, tmp2);
 854         __ std(addr, 0, tmp2); // [_buf + index] := <address_of_card>
 855 
 856         // Restore temp registers and return-from-leaf.
 857         __ bind(ret);




  28 #include "c1/c1_MacroAssembler.hpp"
  29 #include "c1/c1_Runtime1.hpp"
  30 #include "ci/ciUtilities.hpp"
  31 #include "gc/shared/cardTable.hpp"
  32 #include "gc/shared/cardTableBarrierSet.hpp"
  33 #include "interpreter/interpreter.hpp"
  34 #include "nativeInst_ppc.hpp"
  35 #include "oops/compiledICHolder.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "prims/jvmtiExport.hpp"
  38 #include "register_ppc.hpp"
  39 #include "runtime/sharedRuntime.hpp"
  40 #include "runtime/signature.hpp"
  41 #include "runtime/vframeArray.hpp"
  42 #include "utilities/align.hpp"
  43 #include "utilities/macros.hpp"
  44 #include "vmreg_ppc.inline.hpp"
  45 #if INCLUDE_ALL_GCS
  46 #include "gc/g1/g1BarrierSet.hpp"
  47 #include "gc/g1/g1CardTable.hpp"
  48 #include "gc/g1/g1ThreadLocalData.hpp"
  49 #endif
  50 
  51 // Implementation of StubAssembler
  52 
  53 int StubAssembler::call_RT(Register oop_result1, Register metadata_result,
  54                            address entry_point, int number_of_arguments) {
  55   set_num_rt_args(0); // Nothing on stack
  56   assert(!(oop_result1->is_valid() || metadata_result->is_valid()) ||
  57          oop_result1 != metadata_result, "registers must be different");
  58 
  59   // Currently no stack banging. We assume that there are enough
  60   // StackShadowPages (which have been banged in generate_stack_overflow_check)
  61   // for the stub frame and the runtime frames.
  62 
  63   set_last_Java_frame(R1_SP, noreg);
  64 
  65   // ARG1 must hold thread address.
  66   mr(R3_ARG1, R16_thread);
  67 
  68   address return_pc = call_c_with_frame_resize(entry_point, /*No resize, we have a C compatible frame.*/0);


 708       }
 709       break;
 710 
 711 #if INCLUDE_ALL_GCS
 712     case g1_pre_barrier_slow_id:
 713       {
 714         BarrierSet* bs = Universe::heap()->barrier_set();
 715         if (bs->kind() != BarrierSet::G1BarrierSet) {
 716           goto unimplemented_entry;
 717         }
 718 
 719         __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments);
 720 
 721         // Using stack slots: pre_val (pre-pushed), spill tmp, spill tmp2.
 722         const int stack_slots = 3;
 723         Register pre_val = R0; // previous value of memory
 724         Register tmp  = R14;
 725         Register tmp2 = R15;
 726 
 727         Label refill, restart, marking_not_active;
 728         int satb_q_active_byte_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
 729         int satb_q_index_byte_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset());
 730         int satb_q_buf_byte_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset());






 731 
 732         // Spill
 733         __ std(tmp, -16, R1_SP);
 734         __ std(tmp2, -24, R1_SP);
 735 
 736         // Is marking still active?
 737         if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
 738           __ lwz(tmp, satb_q_active_byte_offset, R16_thread);
 739         } else {
 740           assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
 741           __ lbz(tmp, satb_q_active_byte_offset, R16_thread);
 742         }
 743         __ cmpdi(CCR0, tmp, 0);
 744         __ beq(CCR0, marking_not_active);
 745 
 746         __ bind(restart);
 747         // Load the index into the SATB buffer. SATBMarkQueue::_index is a
 748         // size_t so ld_ptr is appropriate.
 749         __ ld(tmp, satb_q_index_byte_offset, R16_thread);
 750 


 807         __ add(addr, tmp2, addr);
 808         __ lbz(tmp, 0, addr); // tmp := [addr + cardtable]
 809 
 810         // Return if young card.
 811         __ cmpwi(CCR0, tmp, G1CardTable::g1_young_card_val());
 812         __ beq(CCR0, ret);
 813 
 814         // Return if sequential consistent value is already dirty.
 815         __ membar(Assembler::StoreLoad);
 816         __ lbz(tmp, 0, addr); // tmp := [addr + cardtable]
 817 
 818         __ cmpwi(CCR0, tmp, G1CardTable::dirty_card_val());
 819         __ beq(CCR0, ret);
 820 
 821         // Not dirty.
 822 
 823         // First, dirty it.
 824         __ li(tmp, G1CardTable::dirty_card_val());
 825         __ stb(tmp, 0, addr);
 826 
 827         int dirty_card_q_index_byte_offset = in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset());
 828         int dirty_card_q_buf_byte_offset = in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset());




 829 
 830         __ bind(restart);
 831 
 832         // Get the index into the update buffer. DirtyCardQueue::_index is
 833         // a size_t so ld_ptr is appropriate here.
 834         __ ld(tmp2, dirty_card_q_index_byte_offset, R16_thread);
 835 
 836         // index == 0?
 837         __ cmpdi(CCR0, tmp2, 0);
 838         __ beq(CCR0, refill);
 839 
 840         __ ld(tmp, dirty_card_q_buf_byte_offset, R16_thread);
 841         __ addi(tmp2, tmp2, -oopSize);
 842 
 843         __ std(tmp2, dirty_card_q_index_byte_offset, R16_thread);
 844         __ add(tmp2, tmp, tmp2);
 845         __ std(addr, 0, tmp2); // [_buf + index] := <address_of_card>
 846 
 847         // Restore temp registers and return-from-leaf.
 848         __ bind(ret);


< prev index next >