< prev index next >

src/hotspot/share/gc/shared/c2/cardTableBarrierSetC2.cpp

Print this page
*** 21,10 ***
--- 21,11 ---
   * questions.
   *
   */
  
  #include "ci/ciUtilities.hpp"
+ #include "code/aotCodeCache.hpp"
  #include "gc/shared/c2/cardTableBarrierSetC2.hpp"
  #include "gc/shared/cardTable.hpp"
  #include "gc/shared/cardTableBarrierSet.hpp"
  #include "gc/shared/gc_globals.hpp"
  #include "opto/arraycopynode.hpp"

*** 112,17 ***
    post_barrier(access.kit(), access.base(), access.addr().node(), new_val, true);
  
    return result;
  }
  
! Node* CardTableBarrierSetC2::byte_map_base_node(GraphKit* kit) const {
    // Get base of card map
    CardTable::CardValue* card_table_base = ci_card_table_address_const();
     if (card_table_base != nullptr) {
       return kit->makecon(TypeRawPtr::make((address)card_table_base));
     } else {
!      return kit->null();
     }
  }
  
  // vanilla post barrier
  // Insert a write-barrier store.  This is to let generational GC work; we have
--- 113,24 ---
    post_barrier(access.kit(), access.base(), access.addr().node(), new_val, true);
  
    return result;
  }
  
! Node* CardTableBarrierSetC2::byte_map_base_node(IdealKit* kit) const {
    // Get base of card map
+ #if INCLUDE_CDS
+   if (AOTCodeCache::is_on_for_dump()) {
+     // load the card table address from the AOT Runtime Constants area
+     Node* byte_map_base_adr = kit->makecon(TypeRawPtr::make(AOTRuntimeConstants::card_table_address()));
+     return kit->load_aot_const(byte_map_base_adr, TypeRawPtr::NOTNULL);
+   }
+ #endif
    CardTable::CardValue* card_table_base = ci_card_table_address_const();
     if (card_table_base != nullptr) {
       return kit->makecon(TypeRawPtr::make((address)card_table_base));
     } else {
!      return kit->makecon(Type::get_zero_type(T_ADDRESS));
     }
  }
  
  // vanilla post barrier
  // Insert a write-barrier store.  This is to let generational GC work; we have

*** 166,11 ***
  
    // Divide by card size
    Node* card_offset = __ URShiftX(cast, __ ConI(CardTable::card_shift()));
  
    // Combine card table base and card offset
!   Node* card_adr = __ AddP(__ top(), byte_map_base_node(kit), card_offset);
  
    // Get the alias_index for raw card-mark memory
    int adr_type = Compile::AliasIdxRaw;
  
    // Dirty card value to store
--- 174,11 ---
  
    // Divide by card size
    Node* card_offset = __ URShiftX(cast, __ ConI(CardTable::card_shift()));
  
    // Combine card table base and card offset
!   Node* card_adr = __ AddP(__ top(), byte_map_base_node(&ideal), card_offset);
  
    // Get the alias_index for raw card-mark memory
    int adr_type = Compile::AliasIdxRaw;
  
    // Dirty card value to store
< prev index next >