< 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"

@@ -33,18 +34,25 @@
  #include "opto/macro.hpp"
  #include "utilities/macros.hpp"
  
  #define __ ideal.
  
- Node* CardTableBarrierSetC2::byte_map_base_node(GraphKit* kit) const {
+ 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();
-    if (card_table_base != nullptr) {
-      return kit->makecon(TypeRawPtr::make((address)card_table_base));
-    } else {
-      return kit->null();
-    }
+   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
  // to flag all oop-stores before the next GC point.

@@ -87,11 +95,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);
+   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 >