The size of arrays and java.lang.Class instances are stored in "length" and "oop_size" fields within the object. The contract for object initialization is that once the object header has been set non-zero (the klass field in particular), the object is parsable by concurrent GCs.
Although the source code is writing the fields in the correct order (afterJDK-8158946 is fixed), there are no memory fences to ensure that the compiler or CPU doesn't reorder the writes or reads of these fields.
Although the source code is writing the fields in the correct order (after
- relates to
-
JDK-8166811 Missing memory fences between memory allocation and refinement
- Resolved
-
JDK-8158946 btree009 fails with assert(s > 0) failed: Bad size calculated
- Resolved
-
JDK-8159864 gc/stress/TestStressRSetCoarsening.java hits assert assert(ILocked()) failed: invariant
- Closed
1.
|
Add release barriers when allocating objects with concurrent collection | Resolved | Kim Barrett | ||
2.
|
Remove unused HeapRegion::object_iterate_mem_careful() | Resolved | Kim Barrett | ||
3.
|
Eliminate ParNew's use of klass_or_null() | Resolved | Kim Barrett | ||
4.
|
Add oopDesc::klass_or_null_acquire() | Resolved | Kim Barrett | ||
5.
|
G1 needs klass_or_null_acquire | Resolved | Kim Barrett | ||
6.
|
Simplify oops_on_card_seq_iterate_careful | Resolved | Kim Barrett | ||
7.
|
CMS needs klass_or_null_acquire | Resolved | Kim Barrett |