Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calculateFieldDataStart in flat field case #5057

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions runtime/vm/ObjectFieldInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,15 @@ class ObjectFieldInfo {
{
U_32 fieldDataStart = 0;
if (!isContendedClassLayout()) {
fieldDataStart = getSuperclassFieldsSize();
bool doubleAlignment = (_totalDoubleCount > 0);
#ifdef J9VM_OPT_VALHALLA_VALUE_TYPES
doubleAlignment = doubleAlignment || (_totalFlatFieldDoubleBytes > 0);
#endif /* J9VM_OPT_VALHALLA_VALUE_TYPES */

fieldDataStart = getSuperclassFieldsSize();
if (
((getSuperclassObjectSize() % OBJECT_SIZE_INCREMENT_IN_BYTES) != 0) && /* superclass is not end-aligned */
((_totalDoubleCount > 0) || (!_objectCanUseBackfill && (_totalObjectCount > 0)))
(doubleAlignment || (!_objectCanUseBackfill && (_totalObjectCount > 0)))
){ /* our fields start on a 8-byte boundary */
fieldDataStart += BACKFILL_SIZE;
}
Expand Down