< prev index next >

src/hotspot/share/gc/shared/c1/cardTableBarrierSetC1.cpp

Print this page
*** 20,10 ***
--- 20,11 ---
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   *
   */
  
+ #include "code/aotCodeCache.hpp"
  #include "gc/shared/c1/cardTableBarrierSetC1.hpp"
  #include "gc/shared/cardTable.hpp"
  #include "gc/shared/cardTableBarrierSet.hpp"
  #include "gc/shared/gc_globals.hpp"
  #include "utilities/macros.hpp"

*** 62,10 ***
--- 63,11 ---
      addr = ptr;
    }
    assert(addr->is_register(), "must be a register at this point");
  
  #ifdef CARDTABLEBARRIERSET_POST_BARRIER_HELPER
+   assert(!AOTCodeCache::is_on(), "this path is not implemented");
    gen->CardTableBarrierSet_post_barrier_helper(addr, card_table_base);
  #else
    LIR_Opr tmp = gen->new_pointer_register();
    if (two_operand_lir_form) {
      LIR_Opr addr_opr = LIR_OprFact::address(new LIR_Address(addr, addr->type()));

*** 74,10 ***
--- 76,21 ---
    } else {
      __ unsigned_shift_right(addr, CardTable::card_shift(), tmp);
    }
  
    LIR_Address* card_addr;
+ #if INCLUDE_CDS
+   if (AOTCodeCache::is_on_for_dump()) {
+     // load the card table address from the AOT Runtime Constants area
+     LIR_Opr byte_map_base_adr = LIR_OprFact::intptrConst(AOTRuntimeConstants::card_table_address());
+     LIR_Opr byte_map_base_reg = gen->new_pointer_register();
+     __ move(byte_map_base_adr, byte_map_base_reg);
+     LIR_Address* byte_map_base_indirect = new LIR_Address(byte_map_base_reg, 0, T_LONG);
+     __ move(byte_map_base_indirect, byte_map_base_reg);
+     card_addr = new LIR_Address(tmp, byte_map_base_reg, T_BYTE);
+   } else
+ #endif
    if (gen->can_inline_as_constant(card_table_base)) {
      card_addr = new LIR_Address(tmp, card_table_base->as_jint(), T_BYTE);
    } else {
      card_addr = new LIR_Address(tmp, gen->load_constant(card_table_base), T_BYTE);
    }
< prev index next >