@@ -433,18 +433,24 @@ class ObjectFieldInfo {
433
433
calculateFieldDataStart (void )
434
434
{
435
435
U_32 fieldDataStart = 0 ;
436
- if (!isContendedClassLayout ()) {
436
+ if (isContendedClassLayout ()) {
437
+ if (TrcEnabled_Trc_VM_contendedClass) {
438
+ J9UTF8 *className = J9ROMCLASS_CLASSNAME (_romClass);
439
+ U_32 utfLength = J9UTF8_LENGTH (className);
440
+ U_8 *utfData = J9UTF8_DATA (className);
441
+ Trc_VM_contendedClass (utfLength, utfData);
442
+ }
443
+ fieldDataStart = getPaddedTrueNonContendedSize () - _objectHeaderSize;
444
+ } else {
437
445
bool doubleAlignment = (_totalDoubleCount > 0 );
438
446
bool hasObjects = _totalObjectCount > 0 ;
439
447
#if defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES)
440
-
441
448
/* If the type has double field the doubles need to start on an 8-byte boundary. In the case of valuetypes
442
449
* there is no lockword so the super class field size will be zero. This means that valueTypes in compressedrefs
443
450
* mode with double alignment fields need to be pre-padded.
444
451
*/
445
452
doubleAlignment = (doubleAlignment || (_totalFlatFieldDoubleBytes > 0 ));
446
453
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
447
-
448
454
fieldDataStart = getSuperclassFieldsSize ();
449
455
if (((getSuperclassObjectSize () % OBJECT_SIZE_INCREMENT_IN_BYTES) != 0 ) /* superclass is not end-aligned */
450
456
&& (doubleAlignment || (!_objectCanUseBackfill && hasObjects))
@@ -464,14 +470,6 @@ class ObjectFieldInfo {
464
470
fieldDataStart += BACKFILL_SIZE;
465
471
#endif /* defined(J9VM_OPT_VALHALLA_FLATTENABLE_VALUE_TYPES) */
466
472
}
467
- } else {
468
- if (TrcEnabled_Trc_VM_contendedClass) {
469
- J9UTF8 *className = J9ROMCLASS_CLASSNAME (_romClass);
470
- U_32 utfLength = J9UTF8_LENGTH (className);
471
- U_8 *utfData = J9UTF8_DATA (className);
472
- Trc_VM_contendedClass (utfLength, utfData);
473
- }
474
- fieldDataStart = getPaddedTrueNonContendedSize () - _objectHeaderSize;
475
473
}
476
474
return fieldDataStart;
477
475
}
0 commit comments