src/share/vm/memory/cardTableModRefBS.hpp

changeset 6493
3205e78d8193
parent 5811
d55c004e1d4d
child 6680
78bbf4d43a14
     1.1 --- a/src/share/vm/memory/cardTableModRefBS.hpp	Thu Dec 05 15:13:12 2013 -0800
     1.2 +++ b/src/share/vm/memory/cardTableModRefBS.hpp	Mon Dec 02 10:26:14 2013 +0100
     1.3 @@ -292,7 +292,7 @@
     1.4    // these functions here for performance.
     1.5  protected:
     1.6    void write_ref_field_work(oop obj, size_t offset, oop newVal);
     1.7 -  virtual void write_ref_field_work(void* field, oop newVal);
     1.8 +  virtual void write_ref_field_work(void* field, oop newVal, bool release = false);
     1.9  public:
    1.10  
    1.11    bool has_write_ref_array_opt() { return true; }
    1.12 @@ -324,9 +324,14 @@
    1.13  
    1.14    template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {}
    1.15  
    1.16 -  template <class T> inline void inline_write_ref_field(T* field, oop newVal) {
    1.17 +  template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release) {
    1.18      jbyte* byte = byte_for((void*)field);
    1.19 -    *byte = dirty_card;
    1.20 +    if (release) {
    1.21 +      // Perform a releasing store if requested.
    1.22 +      OrderAccess::release_store((volatile jbyte*) byte, dirty_card);
    1.23 +    } else {
    1.24 +      *byte = dirty_card;
    1.25 +    }
    1.26    }
    1.27  
    1.28    // These are used by G1, when it uses the card table as a temporary data

mercurial