hotspot/src/share/vm/memory/cardTableModRefBS.hpp
changeset 29081 c61eb4914428
parent 28830 a252e278c3d9
child 29325 0e86e64c66e5
equal deleted inserted replaced
29080:a16b0d9a08f5 29081:c61eb4914428
    25 #ifndef SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
    25 #ifndef SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
    26 #define SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
    26 #define SHARE_VM_MEMORY_CARDTABLEMODREFBS_HPP
    27 
    27 
    28 #include "memory/modRefBarrierSet.hpp"
    28 #include "memory/modRefBarrierSet.hpp"
    29 #include "oops/oop.hpp"
    29 #include "oops/oop.hpp"
    30 #include "oops/oop.inline2.hpp"
       
    31 
    30 
    32 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
    31 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
    33 // enumerate ref fields that have been modified (since the last
    32 // enumerate ref fields that have been modified (since the last
    34 // enumeration.)
    33 // enumeration.)
    35 
    34 
    43 
    42 
    44 class Generation;
    43 class Generation;
    45 class OopsInGenClosure;
    44 class OopsInGenClosure;
    46 class DirtyCardToOopClosure;
    45 class DirtyCardToOopClosure;
    47 class ClearNoncleanCardWrapper;
    46 class ClearNoncleanCardWrapper;
       
    47 class CardTableRS;
    48 
    48 
    49 class CardTableModRefBS: public ModRefBarrierSet {
    49 class CardTableModRefBS: public ModRefBarrierSet {
    50   // Some classes get to look at some private stuff.
    50   // Some classes get to look at some private stuff.
    51   friend class BytecodeInterpreter;
    51   friend class BytecodeInterpreter;
    52   friend class VMStructs;
    52   friend class VMStructs;
   331 
   331 
   332   // *** Card-table-barrier-specific things.
   332   // *** Card-table-barrier-specific things.
   333 
   333 
   334   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {}
   334   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {}
   335 
   335 
   336   template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release) {
   336   template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release);
   337     jbyte* byte = byte_for((void*)field);
       
   338     if (release) {
       
   339       // Perform a releasing store if requested.
       
   340       OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
       
   341     } else {
       
   342       *byte = dirty_card;
       
   343     }
       
   344   }
       
   345 
   337 
   346   // These are used by G1, when it uses the card table as a temporary data
   338   // These are used by G1, when it uses the card table as a temporary data
   347   // structure for card claiming.
   339   // structure for card claiming.
   348   bool is_card_dirty(size_t card_index) {
   340   bool is_card_dirty(size_t card_index) {
   349     return _byte_map[card_index] == dirty_card_val();
   341     return _byte_map[card_index] == dirty_card_val();