src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp
changeset 49752 93d84f667d12
parent 49748 6a880e576856
child 49753 46f2dc7c4c39
equal deleted inserted replaced
49751:c3a10df652c0 49752:93d84f667d12
    27 #include "asm/macroAssembler.inline.hpp"
    27 #include "asm/macroAssembler.inline.hpp"
    28 #include "registerSaver_s390.hpp"
    28 #include "registerSaver_s390.hpp"
    29 #include "gc/g1/g1CardTable.hpp"
    29 #include "gc/g1/g1CardTable.hpp"
    30 #include "gc/g1/g1BarrierSet.hpp"
    30 #include "gc/g1/g1BarrierSet.hpp"
    31 #include "gc/g1/g1BarrierSetAssembler.hpp"
    31 #include "gc/g1/g1BarrierSetAssembler.hpp"
       
    32 #include "gc/g1/g1ThreadLocalData.hpp"
    32 #include "gc/g1/heapRegion.hpp"
    33 #include "gc/g1/heapRegion.hpp"
    33 #include "gc/shared/collectedHeap.hpp"
    34 #include "gc/shared/collectedHeap.hpp"
    34 #include "runtime/thread.hpp"
       
    35 #include "interpreter/interp_masm.hpp"
    35 #include "interpreter/interp_masm.hpp"
    36 
    36 
    37 #define __ masm->
    37 #define __ masm->
    38 
    38 
    39 #define BLOCK_COMMENT(str) if (PrintAssembly) __ block_comment(str)
    39 #define BLOCK_COMMENT(str) if (PrintAssembly) __ block_comment(str)
    47     // Is marking active?
    47     // Is marking active?
    48     Label filtered;
    48     Label filtered;
    49     assert_different_registers(addr,  Z_R0_scratch);  // would be destroyed by push_frame()
    49     assert_different_registers(addr,  Z_R0_scratch);  // would be destroyed by push_frame()
    50     assert_different_registers(count, Z_R0_scratch);  // would be destroyed by push_frame()
    50     assert_different_registers(count, Z_R0_scratch);  // would be destroyed by push_frame()
    51     Register Rtmp1 = Z_R0_scratch;
    51     Register Rtmp1 = Z_R0_scratch;
    52     const int active_offset = in_bytes(JavaThread::satb_mark_queue_offset() +
    52     const int active_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
    53                                        SATBMarkQueue::byte_offset_of_active());
       
    54     if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
    53     if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
    55       __ load_and_test_int(Rtmp1, Address(Z_thread, active_offset));
    54       __ load_and_test_int(Rtmp1, Address(Z_thread, active_offset));
    56     } else {
    55     } else {
    57       guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
    56       guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
    58       __ load_and_test_byte(Rtmp1, Address(Z_thread, active_offset));
    57       __ load_and_test_byte(Rtmp1, Address(Z_thread, active_offset));
   125   bool not_null  = (decorators & OOP_NOT_NULL) != 0,
   124   bool not_null  = (decorators & OOP_NOT_NULL) != 0,
   126        preloaded = obj == NULL;
   125        preloaded = obj == NULL;
   127 
   126 
   128   const Register Robj = obj ? obj->base() : noreg,
   127   const Register Robj = obj ? obj->base() : noreg,
   129                  Roff = obj ? obj->index() : noreg;
   128                  Roff = obj ? obj->index() : noreg;
   130   const int active_offset = in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_active());
   129   const int active_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
   131   const int buffer_offset = in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_buf());
   130   const int buffer_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_buffer_offset());
   132   const int index_offset  = in_bytes(JavaThread::satb_mark_queue_offset() + SATBMarkQueue::byte_offset_of_index());
   131   const int index_offset  = in_bytes(G1ThreadLocalData::satb_mark_queue_index_offset());
   133   assert_different_registers(Rtmp1, Rtmp2, Z_R0_scratch); // None of the Rtmp<i> must be Z_R0!!
   132   assert_different_registers(Rtmp1, Rtmp2, Z_R0_scratch); // None of the Rtmp<i> must be Z_R0!!
   134   assert_different_registers(Robj, Z_R0_scratch);         // Used for addressing. Furthermore, push_frame destroys Z_R0!!
   133   assert_different_registers(Robj, Z_R0_scratch);         // Used for addressing. Furthermore, push_frame destroys Z_R0!!
   135   assert_different_registers(Rval, Z_R0_scratch);         // push_frame destroys Z_R0!!
   134   assert_different_registers(Rval, Z_R0_scratch);         // push_frame destroys Z_R0!!
   136 
   135 
   137   Label callRuntime, filtered;
   136   Label callRuntime, filtered;
   322   __ z_mvi(0, Rcard_addr, G1CardTable::dirty_card_val());
   321   __ z_mvi(0, Rcard_addr, G1CardTable::dirty_card_val());
   323 
   322 
   324   Register Rcard_addr_x = Rcard_addr;
   323   Register Rcard_addr_x = Rcard_addr;
   325   Register Rqueue_index = (Rtmp2 != Z_R0_scratch) ? Rtmp2 : Rtmp1;
   324   Register Rqueue_index = (Rtmp2 != Z_R0_scratch) ? Rtmp2 : Rtmp1;
   326   Register Rqueue_buf   = (Rtmp3 != Z_R0_scratch) ? Rtmp3 : Rtmp1;
   325   Register Rqueue_buf   = (Rtmp3 != Z_R0_scratch) ? Rtmp3 : Rtmp1;
   327   const int qidx_off    = in_bytes(JavaThread::dirty_card_queue_offset() + SATBMarkQueue::byte_offset_of_index());
   326   const int qidx_off    = in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset());
   328   const int qbuf_off    = in_bytes(JavaThread::dirty_card_queue_offset() + SATBMarkQueue::byte_offset_of_buf());
   327   const int qbuf_off    = in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset());
   329   if ((Rcard_addr == Rqueue_buf) || (Rcard_addr == Rqueue_index)) {
   328   if ((Rcard_addr == Rqueue_buf) || (Rcard_addr == Rqueue_index)) {
   330     Rcard_addr_x = Z_R0_scratch;  // Register shortage. We have to use Z_R0.
   329     Rcard_addr_x = Z_R0_scratch;  // Register shortage. We have to use Z_R0.
   331   }
   330   }
   332   __ lgr_if_needed(Rcard_addr_x, Rcard_addr);
   331   __ lgr_if_needed(Rcard_addr_x, Rcard_addr);
   333 
   332