提交 7a24d17f 编写于 作者: A aph

8138966: Intermittent SEGV running ParallelGC

Summary: Add necessary memory fences so that the parallel threads are unable to observe partially filled block tables.
Reviewed-by: tschatzl
上级 eeceff96
...@@ -348,7 +348,7 @@ public: ...@@ -348,7 +348,7 @@ public:
HeapWord* _partial_obj_addr; HeapWord* _partial_obj_addr;
region_sz_t _partial_obj_size; region_sz_t _partial_obj_size;
region_sz_t volatile _dc_and_los; region_sz_t volatile _dc_and_los;
bool _blocks_filled; bool volatile _blocks_filled;
#ifdef ASSERT #ifdef ASSERT
size_t _blocks_filled_count; // Number of block table fills. size_t _blocks_filled_count; // Number of block table fills.
...@@ -499,7 +499,9 @@ ParallelCompactData::RegionData::destination_count() const ...@@ -499,7 +499,9 @@ ParallelCompactData::RegionData::destination_count() const
inline bool inline bool
ParallelCompactData::RegionData::blocks_filled() const ParallelCompactData::RegionData::blocks_filled() const
{ {
return _blocks_filled; bool result = _blocks_filled;
OrderAccess::acquire();
return result;
} }
#ifdef ASSERT #ifdef ASSERT
...@@ -513,6 +515,7 @@ ParallelCompactData::RegionData::blocks_filled_count() const ...@@ -513,6 +515,7 @@ ParallelCompactData::RegionData::blocks_filled_count() const
inline void inline void
ParallelCompactData::RegionData::set_blocks_filled() ParallelCompactData::RegionData::set_blocks_filled()
{ {
OrderAccess::release();
_blocks_filled = true; _blocks_filled = true;
// Debug builds count the number of times the table was filled. // Debug builds count the number of times the table was filled.
DEBUG_ONLY(Atomic::inc_ptr(&_blocks_filled_count)); DEBUG_ONLY(Atomic::inc_ptr(&_blocks_filled_count));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册