Skip to content

Commit e546e71

Browse files
Aleksandar MicicAleksandar Micic
authored andcommitted
Don't use adjacancy check for arraylets in WOC fixup
When fixing up contiguous reference arrays in Write Once Compactor the rules should be: - pick any, if arraylet mode (offheap disabled) - pick any fully initialized array (dataAddr is set), if offheap enabled mode No need to check if data is adjacent - it's given by these conditions. More so, it's not even correct to use is-adjacent API for arraylet mode. Signed-off-by: Aleksandar Micic <[email protected]>
1 parent cc83b6a commit e546e71

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

runtime/gc_vlhgc/WriteOnceCompactor.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,16 +1380,15 @@ MM_WriteOnceCompactor::fixupPointerArrayObject(MM_EnvironmentVLHGC* env, J9Objec
13801380
GC_ArrayletObjectModel::ArrayLayout layout = indexableObjectModel->getArrayLayout((J9IndexableObject *)objectPtr);
13811381

13821382
if (GC_ArrayletObjectModel::InlineContiguous == layout) {
1383-
/* For offheap we need a special check for the case of a partially offheap allocated array that caused the current GC
1384-
* (its dataAddr field will still be NULL), with offheap heap we will fixup camouflaged discontiguous arrays) - DM, like default
1385-
* balanced, wants to fixup only truly contiguous arrays
1383+
/* For offheap enabled, a special check is needed for the case of a partially offheap allocated array that caused the current GC
1384+
* (its dataAddr field will still be NULL).
1385+
* For offheap disabled, any contiguous is scanned.
13861386
*/
1387-
if (indexableObjectModel->isDataAdjacentToHeader((J9IndexableObject *)objectPtr)
13881387
#if defined(J9VM_ENV_DATA64)
1389-
|| (indexableObjectModel->isVirtualLargeObjectHeapEnabled()
1390-
&& (NULL != indexableObjectModel->getDataAddrForContiguous((J9IndexableObject *)objectPtr)))
1388+
if (!indexableObjectModel->isVirtualLargeObjectHeapEnabled()
1389+
|| (NULL != indexableObjectModel->getDataAddrForContiguous((J9IndexableObject *)objectPtr)))
13911390
#endif /* defined(J9VM_ENV_DATA64) */
1392-
) {
1391+
{
13931392
uintptr_t elementsToWalk = indexableObjectModel->getSizeInElements((J9IndexableObject *)objectPtr);
13941393
GC_PointerArrayIterator it(_javaVM, objectPtr);
13951394
uintptr_t previous = 0;

0 commit comments

Comments
 (0)