-
Notifications
You must be signed in to change notification settings - Fork 737
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
base: master
Are you sure you want to change the base?
Conversation
Use consistent data types and code formatting Signed-off-by: lhu <[email protected]>
@amicic @dmitripivkine please review the changes, Thanks |
{ | ||
return ((_heapBase <= (U_8 *)objectPtr) && (_heapTop > (U_8 *)objectPtr)); | ||
return ((_heapBase <= (uint8_t *)objectPtr) && (_heapTop > (uint8_t *)objectPtr)); |
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.
The outermost parentheses are specifically unwanted; the OMR coding standard says
Do not enclose the return value in parentheses.
@@ -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).
Use consistent data types and code formatting