-
Notifications
You must be signed in to change notification settings - Fork 740
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
Clean up CopyForwardScheme class #21072
Clean up CopyForwardScheme class #21072
Conversation
@amicic @dmitripivkine please review the changes, Thanks |
@@ -705,14 +705,14 @@ MM_CopyForwardScheme::reinitCache(MM_EnvironmentVLHGC *env, MM_CopyScanCacheVLHG | |||
|
|||
MM_HeapRegionDescriptorVLHGC * region = (MM_HeapRegionDescriptorVLHGC *)_regionManager->tableDescriptorForAddress(cache->cacheBase); | |||
Trc_MM_CopyForwardScheme_reinitCache(env->getLanguageVMThread(), _regionManager->mapDescriptorToRegionTableIndex(region), cache, | |||
region->getAllocationAgeSizeProduct() / (1024 * 1024) / (1024 * 1024), (double)((UDATA)cache->cacheAlloc - (UDATA)region->getLowAddress()) / (1024 * 1024)); | |||
region->getAllocationAgeSizeProduct() / (1024 * 1024) / (1024 * 1024), (double)((uintptr_t)cache->cacheAlloc - (uintptr_t)region->getLowAddress()) / (1024 * 1024)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really want to work with TB (dividing by 1MB twice)?
@@ -1284,7 +1284,7 @@ MM_CopyForwardScheme::copyAndForward(MM_EnvironmentVLHGC *env, MM_AllocationCont | |||
/* Object has been copied - update the forwarding information and return */ | |||
*objectPtrIndirect = objectPtr; | |||
} else { | |||
Assert_GC_true_with_message(env, (UDATA)0x99669966 == _extensions->objectModel.getPreservedClass(&forwardHeader)->eyecatcher, "Invalid class in objectPtr=%p\n", originalObjectPtr); | |||
Assert_GC_true_with_message(env, (uintptr_t)0x9966uintptr_t== _extensions->objectModel.getPreservedClass(&forwardHeader)->eyecatcher, "Invalid class in objectPtr=%p\n", originalObjectPtr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't expect this will compile. I don't think the second uintptr_t
was intended here.
UDATA *leafPtr = (UDATA *)J9GC_J9OBJECT_CLAZZ(objectPtr, env)->instanceLeafDescription; | ||
UDATA leafBits; | ||
uintptr_t *leafPtr = (uintptr_t *)J9GC_J9OBJECT_CLAZZ(objectPtr, env)->instanceLeafDescription; | ||
UDATuintptr_tfBits; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another compile error?
@@ -2799,7 +2799,7 @@ MM_CopyForwardScheme::getNextWorkUnit(MM_EnvironmentVLHGC *env, UDATA preferredN | |||
while (!isAnyScanWorkAvailable(env) && (doneIndex == _doneIndex)) { | |||
#if defined(J9MODRON_TGC_PARALLEL_STATISTICS) | |||
PORT_ACCESS_FROM_ENVIRONMENT(env); | |||
U_64 waitEndTime, waitStartTime; | |||
uint8_t waitEndTime, waitStartTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you meant uint64_t
, and each local should be declared (and initialized separately).
dc9f2a6
to
7d96658
Compare
53473c9
to
eddf6c8
Compare
@@ -3600,7 +3602,7 @@ void | |||
MM_CopyForwardScheme::cleanCardTableForPartialCollect(MM_EnvironmentVLHGC *env, MM_CardCleaner *cardCleaner) | |||
{ | |||
PORT_ACCESS_FROM_ENVIRONMENT(env); | |||
U_64 cleanStartTime = j9time_hires_clock(); | |||
uint8_t cleanStartTime = j9time_hires_clock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space at wrong side of star line 3608
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mistake: type should be uint64_t
eddf6c8
to
194c4bf
Compare
Assert_MM_false(UDATA_MAX == compactGroup->_markMapPGCSlotIndex); /* Safety check from flushing to see if somehow the cache is being resurrected */ | ||
Assert_MM_false(UDATA_MAX == compactGroup->_markMapGMPSlotIndex); /* Safety check from flushing to see if somehow the cache is being resurrected */ | ||
Assert_MM_false(uintptr_t_MAX == compactGroup->_markMapPGCSlotIndex); /* Safety check from flushing to see if somehow the cache is being resurrected */ | ||
Assert_MM_false(uintptr_t_MAX == compactGroup->_markMapGMPSlotIndex); /* Safety check from flushing to see if somehow the cache is being resurrected */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these two lines have been updated by mistake
@@ -2873,7 +2874,8 @@ MM_CopyForwardScheme::getNextWorkUnitNoWait(MM_EnvironmentVLHGC *env, UDATA pref | |||
} | |||
if (SCAN_REASON_NONE == ret && (0 != _regionCountCannotBeEvacuated) && !abortFlagRaised()) { | |||
if (env->_workStack.retrieveInputPacket(env)) { | |||
ret = SCAN_REASON_PACKET; | |||
ret = SCAN_REASON_PACKET;1188 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove garbage and empty line
{ | ||
if (cache == NULL) { | ||
return SCAN_TO_COPY_CACHE_MAX_DISTANCE; | ||
} | ||
IDATA distance = ((UDATA) cache->cacheAlloc) - ((UDATA) cache->scanCurrent); | ||
UDATA udistance; | ||
IDATA distance = ((uintptr_t) cache->cacheAlloc) - ((uintptr_t) cache->scanCurrent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDATA should be replaced to intptr_t
@@ -3659,7 +3661,7 @@ MM_CopyForwardScheme::cleanCardTableForPartialCollect(MM_EnvironmentVLHGC *env, | |||
} | |||
} | |||
|
|||
U_64 cleanEndTime = j9time_hires_clock(); | |||
uint8_t cleanEndTime = j9time_hires_clock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mistake: type should be uint64_t
|
||
Assert_MM_true(0 != usedBytes); | ||
|
||
/* convert allocation age product (usedBytes * age) back to pure age */ | ||
U_64 newAllocationAge = (U_64)(region->getAllocationAgeSizeProduct() / (double)usedBytes); | ||
uint8_t newAllocationAge = (uint8_t)(region->getAllocationAgeSizeProduct() / (double)usedBytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mistake: type should be uint64_t
omrthread_monitor_t _scanCacheMonitor; /**< Used when waiting on work on any of the _cacheScanLists */ | ||
|
||
volatile UDATA* _workQueueWaitCountPtr; /**< The number of threads currently sleeping on *_workQueueMonitorPtr, awaiting scan cache work or work from packets*/ | ||
omrthread_monitor_t* _workQueueMonitorPtr; /**< Used when waiting on work on any of the _cacheScanLists or workPackets*/ | ||
volatile uintptr_t* _workQueueWaitCountPtr; /**< The number of threads currently sleeping on *_workQueueMonitorPtr, awaiting scan cache work or work from packets*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space at the wrong side of the star
194c4bf
to
6326631
Compare
Use consistent data types and code formatting Signed-off-by: lhu <[email protected]>
6326631
to
19a56fe
Compare
Jenkins test sanity xLinux,aix jdk21 |
AIX build failed due infra reason, merging |
Use consistent data types and code formatting