-
Notifications
You must be signed in to change notification settings - Fork 721
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
Replace J9VM_MODRON_SCAVENGER_CACHE_* to OMR_COPYSCAN_CACHE_* #16820
Conversation
@@ -52,7 +52,7 @@ class MM_CopyScanCacheVLHGC : public MM_CopyScanCache | |||
UDATA _objectSize; /**< sum of objects sizes copied to this copy cache */ | |||
U_64 _lowerAgeBound; /**< lowest possible age of any object in this copy cache */ | |||
U_64 _upperAgeBound; /**< highest possible age of any object in this copy cache */ | |||
UDATA _arraySplitIndex; /**< The index within the array in scanCurrent to start scanning from (meaningful is J9VM_MODRON_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY is set) */ | |||
UDATA _arraySplitIndex; /**< The index within the array in scanCurrent to start scanning from (meaningful is OMR_SCAVENGER_CACHE_TYPE_SPLIT_ARRAY is set) */ |
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.
While touching this, I recommend to replace UDATA with uintptr_t, and similar ones, too. Base MM_CopyScanCache already uses uintptr_t.
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.
same for other smaller files you touched
@@ -143,7 +143,7 @@ MM_CopyScanCacheListVLHGC::removeAllHeapAllocatedChunks(MM_EnvironmentVLHGC *env | |||
MM_CopyScanCacheVLHGC *cache = cacheList->_cacheHead; | |||
|
|||
while(cache != NULL) { |
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.
try to fix some formatting too, in nearby code - missing spacing between 'while' and '('
@@ -31,9 +31,9 @@ | |||
UDATA |
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.
missed this one
if(0 == (cache->flags & J9VM_MODRON_SCAVENGER_CACHE_TYPE_COPY)) { | ||
if(0 == (cache->flags & J9VM_MODRON_SCAVENGER_CACHE_TYPE_CLEARED)) { | ||
if(0 == (cache->flags & OMR_SCAVENGER_CACHE_TYPE_COPY)) { | ||
if(0 == (cache->flags & OMR_SCAVENGER_CACHE_TYPE_CLEARED)) { |
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.
missing space after 'if'
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.
Also, it should use OMR_ARE_NO_BITS_SET()
.
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.
Also, it should use
OMR_ARE_NO_BITS_SET()
.
Bit functions like this are not used in GC code. I am not sure we should start to use them now
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.
They are even used in this file, see line 2622, for example.
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 already stated our current view on when to use these macros in a previous comment (#16820 (comment)) and you said you'd respect that.
The example you refer to now fits within VM flags, while this PR deals with a GC specific flag.
Being unified within a file is also important, but of a secondary priority (relative to the criteria I mentioned)
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.
Still disappointed, but I did say that.
@@ -2906,7 +2906,7 @@ MM_CopyForwardScheme::bestCacheForScanning(MM_CopyScanCacheVLHGC* copyCache, MM_ | |||
if (!copyCache->isScanWorkAvailable()) { | |||
return false; | |||
} | |||
if (!((*scanCache)->flags & J9VM_MODRON_SCAVENGER_CACHE_TYPE_COPY)) { | |||
if (!((*scanCache)->flags & OMR_SCAVENGER_CACHE_TYPE_COPY)) { |
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.
this is probably not a style that conforms with coding standard.
we should compare it with 0 (which Scavenger.cpp) uses, or even use some of bitwise macros (common in core VM code, but no so in GC)
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.
Tests like this should use OMR_ARE_NO_BITS_SET()
.
@@ -3266,7 +3266,7 @@ MM_CopyForwardScheme::incrementalScanCacheBySlot(MM_EnvironmentVLHGC *env) | |||
* if deferred cache is occupied, then queue current scan cache on scan list | |||
*/ | |||
scanCache->clearCurrentlyBeingScanned(); | |||
if (!(scanCache->flags & J9VM_MODRON_SCAVENGER_CACHE_TYPE_COPY)) { | |||
if (!(scanCache->flags & OMR_SCAVENGER_CACHE_TYPE_COPY)) { |
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 one that should compare with 0, rather than treating as a bool
return false; | ||
} | ||
|
||
memset((void *)_reservedRegionList, 0, sizeof(MM_ReservedRegionListHeader) * _compactGroupMaxCount); | ||
for(UDATA index = 0; index < _compactGroupMaxCount; index++) { | ||
for (UDATA index = 0; index < _compactGroupMaxCount; index++) { |
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.
well, now that you fixed spacing in this huge file (which I did not expect), you could go and fix UDATA, too :)
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 afraid such update might hide original change, Spaces can be filtered out from view. I suggest to do update of types in separate PR
Depends eclipse/omr#6921 |
@keithc-ca Would you please review DDR part? These constants haven't been used in DDR code. With removing them everywhere there is no need to keep them around. The old set of constants has been replaced to a new one. I think there is no need to add new set to DDR. |
The DDR changes look fine to me. |
need to squash the commits |
@keithc-ca, could you formally approve? |
@@ -4371,15 +4371,15 @@ MM_CopyForwardScheme::scanRoots(MM_EnvironmentVLHGC* env) | |||
|
|||
while (NULL != (classLoader = classLoaderIterator.nextSlot())) { | |||
if (0 == (classLoader->gcFlags & J9_GC_CLASS_LOADER_DEAD)) { | |||
if(J9_ARE_ANY_BITS_SET(classLoader->flags, J9CLASSLOADER_ANON_CLASS_LOADER)) { | |||
if (J9_ARE_ANY_BITS_SET(classLoader->flags, J9CLASSLOADER_ANON_CLASS_LOADER)) { |
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.
Since this code already uses J9_ARE_ANY_BITS_SET()
, it should do so consistently (although I think the OMR equivalents should be preferred). The test here and similar ones on lines 1771,1772, 1786, 2909, 3269, etc., for example should be updated.
@keithc-ca While we, in GC code, are not completely consistent with use of macros of *_BITS_SET(), we tend not to use them. Exceptions for the most part is code that deals with bits that are imposed by core VM structs (public/private flags in J9VMThread, flags in J9Class, etc) while still in GC code, although there are some other minor exceptions. To stay consistent with this state:
|
In my opinion use of those macros has nothing to do with any particular data structure: they're really only about managing bit sets or masks. I'm disappointed you don't agree that their use would improve GC code, but I will respect your position. |
This is non-functional change: Remove usage of J9VM_MODRON_SCAVENGER_CACHE_* defined names, use neutral OMR_COPYSCAN_CACHE_* defined names instead. Usage of Copy Scan Caches is not limited to Scavenger and can be used by other Collectors, Balance for instanse. Also replace variables types according standards for modified files and fix formatting Signed-off-by: Dmitri Pivkine <Dmitri_Pivkine@ca.ibm.com>
jenkins test sanity aix,win jdk11 |
This is non-functional change: Remove usage of
J9VM_MODRON_SCAVENGER_CACHE_*
defined names, use newOMR_COPYSCAN_CACHE_*
defined names instead.Depends on eclipse/omr#6921.