hotspot/src/share/vm/memory/cardTableModRefBS.hpp
changeset 22859 7b88983393b7
parent 20309 7445302daff6
child 24424 2658d7834c6e
equal deleted inserted replaced
22858:f4a6f0eba875 22859:7b88983393b7
   290   // The scanning code has to handle the fact that the write barrier may be
   290   // The scanning code has to handle the fact that the write barrier may be
   291   // either precise or imprecise. We make non-virtual inline variants of
   291   // either precise or imprecise. We make non-virtual inline variants of
   292   // these functions here for performance.
   292   // these functions here for performance.
   293 protected:
   293 protected:
   294   void write_ref_field_work(oop obj, size_t offset, oop newVal);
   294   void write_ref_field_work(oop obj, size_t offset, oop newVal);
   295   virtual void write_ref_field_work(void* field, oop newVal);
   295   virtual void write_ref_field_work(void* field, oop newVal, bool release = false);
   296 public:
   296 public:
   297 
   297 
   298   bool has_write_ref_array_opt() { return true; }
   298   bool has_write_ref_array_opt() { return true; }
   299   bool has_write_region_opt() { return true; }
   299   bool has_write_region_opt() { return true; }
   300 
   300 
   322 
   322 
   323   // *** Card-table-barrier-specific things.
   323   // *** Card-table-barrier-specific things.
   324 
   324 
   325   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {}
   325   template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {}
   326 
   326 
   327   template <class T> inline void inline_write_ref_field(T* field, oop newVal) {
   327   template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release) {
   328     jbyte* byte = byte_for((void*)field);
   328     jbyte* byte = byte_for((void*)field);
   329     *byte = dirty_card;
   329     if (release) {
       
   330       // Perform a releasing store if requested.
       
   331       OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
       
   332     } else {
       
   333       *byte = dirty_card;
       
   334     }
   330   }
   335   }
   331 
   336 
   332   // These are used by G1, when it uses the card table as a temporary data
   337   // These are used by G1, when it uses the card table as a temporary data
   333   // structure for card claiming.
   338   // structure for card claiming.
   334   bool is_card_dirty(size_t card_index) {
   339   bool is_card_dirty(size_t card_index) {