8238961: Assertion failure in new field layout code when ContendedPaddingWidth == 0

Reviewed-by: hseigel, coleenp
This commit is contained in:
Frederic Parain 2020-02-13 11:23:17 -05:00
parent a4616a7b49
commit 30707f8007

View File

@ -353,7 +353,7 @@ void FieldLayout::fill_holes(const InstanceKlass* super_klass) {
// If the super class has @Contended annotation, a padding block is
// inserted at the end to ensure that fields from the subclasses won't share
// the cache line of the last field of the contended class
if (super_klass->has_contended_annotations()) {
if (super_klass->has_contended_annotations() && ContendedPaddingWidth > 0) {
LayoutRawBlock* p = new LayoutRawBlock(LayoutRawBlock::PADDING, ContendedPaddingWidth);
p->set_offset(b->offset() + b->size());
b->set_next_block(p);