Mercurial > hg > truffle
diff src/share/vm/memory/cardTableModRefBS.hpp @ 14443:3205e78d8193
8029396: PPC64 (part 212): Several memory ordering fixes in C-code.
Summary: memory ordering fixes in GC and other runtime code showing on PPC64.
Reviewed-by: kvn, coleenp
author | goetz |
---|---|
date | Mon, 02 Dec 2013 10:26:14 +0100 |
parents | d55c004e1d4d |
children | d8041d695d19 78bbf4d43a14 |
line wrap: on
line diff
--- a/src/share/vm/memory/cardTableModRefBS.hpp Thu Dec 05 15:13:12 2013 -0800 +++ b/src/share/vm/memory/cardTableModRefBS.hpp Mon Dec 02 10:26:14 2013 +0100 @@ -292,7 +292,7 @@ // these functions here for performance. protected: void write_ref_field_work(oop obj, size_t offset, oop newVal); - virtual void write_ref_field_work(void* field, oop newVal); + virtual void write_ref_field_work(void* field, oop newVal, bool release = false); public: bool has_write_ref_array_opt() { return true; } @@ -324,9 +324,14 @@ template <class T> inline void inline_write_ref_field_pre(T* field, oop newVal) {} - template <class T> inline void inline_write_ref_field(T* field, oop newVal) { + template <class T> inline void inline_write_ref_field(T* field, oop newVal, bool release) { jbyte* byte = byte_for((void*)field); - *byte = dirty_card; + if (release) { + // Perform a releasing store if requested. + OrderAccess::release_store((volatile jbyte*) byte, dirty_card); + } else { + *byte = dirty_card; + } } // These are used by G1, when it uses the card table as a temporary data