-
Notifications
You must be signed in to change notification settings - Fork 396
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
Upgrading inlined code to virtual methods for register scavenger #6781
Conversation
@amicic @dmitripivkine please review the change, Thanks |
gc/base/standard/Scavenger.cpp
Outdated
/* register the scavenger in GCExtensionsBase */ | ||
_extensions->registerScavenger(this); | ||
#endif /* OMR_GC_MODRON_SCAVENGER */ | ||
|
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.
minor difference, but i'd keep it at original spot (higher level entity knows better to whom it should be registered)
comment is redundant (the method name is self explanatory)
gc/base/GCExtensionsBase.hpp
Outdated
@@ -906,6 +906,9 @@ class MM_GCExtensionsBase : public MM_BaseVirtual { | |||
MMINLINE OMR_VM* getOmrVM() { return _omrVM; } | |||
MMINLINE void setOmrVM(OMR_VM* omrVM) { _omrVM = omrVM; } | |||
|
|||
#if defined(OMR_GC_MODRON_SCAVENGER) | |||
virtual void registerScavenger(MM_Scavenger *scavenger) { this->scavenger = scavenger; } |
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.
for symmetry, let's introduce unregister, too
it'd be used in MM_ConfigurationGenerational::tearDown
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.
See https://github.com/eclipse/omr/blob/master/doc/CodingStandard.md#variables.
In C++, member variable names should start with an underscore: _scavenger
. This is just a note and does not need to be addressed in this PR since the scavenger
member field was introduced in the past.
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.
Unfortunately whole that class/file does not follow that standard, although by far most of other GC classes do.
Being a top level global GC class, conforming it to the standard would likely touch almost every GC file.
That's probably why nobody so far have tried to do it, but it should have really be done during the major OMR/J9 separation.
68bb805
to
5e9f7c6
Compare
@@ -202,8 +201,7 @@ MM_ConfigurationGenerational::createDefaultMemorySpace(MM_EnvironmentBase *envBa | |||
return NULL; | |||
} | |||
|
|||
/* register the scavenger in GCExtensionsBase */ | |||
ext->scavenger = scavenger; | |||
_extensions->registerScavenger(this); | |||
|
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.
not 'this' but scavenger
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 _extensions really exist?
a15acfa
to
41e4080
Compare
subject and comment are not really correct you are not changing any behavior just upgrading inlined code to virtual methods so that subclasses could override behavior |
@babsingh Could you please review the change, Thanks |
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.
Minor nitpicks.
gc/base/GCExtensionsBase.hpp
Outdated
@@ -906,6 +906,9 @@ class MM_GCExtensionsBase : public MM_BaseVirtual { | |||
MMINLINE OMR_VM* getOmrVM() { return _omrVM; } | |||
MMINLINE void setOmrVM(OMR_VM* omrVM) { _omrVM = omrVM; } | |||
|
|||
#if defined(OMR_GC_MODRON_SCAVENGER) | |||
virtual void registerScavenger(MM_Scavenger *scavenger) { this->scavenger = scavenger; } |
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.
See https://github.com/eclipse/omr/blob/master/doc/CodingStandard.md#variables.
In C++, member variable names should start with an underscore: _scavenger
. This is just a note and does not need to be addressed in this PR since the scavenger
member field was introduced in the past.
@LinHu2016 There is a standalone commit for the new change. There should be only one commit and it should include all the changes. |
jenkins build all |
5c6e5b9
to
2b7ff60
Compare
jenkins build all |
Old zLinux PR build: https://ci.eclipse.org/omr/job/PullRequest-linux_390-64/3942. jenkins build zlinux(cmake:'-DOMR_GC_MODRON_SCAVENGER=OFF') |
In the zLinux PR build with
|
Argh, we either have to revert to having #ifdef outside or use void * (and upcast later) |
Third option is to remove #ifdef around forward declaration #if defined(OMR_GC_MODRON_SCAVENGER) Still, I slightly prefer the least radical (but ugliest to my eye) option to keep (un)registerScavenger under #ifdef, but again open to hear opinions. |
I will remove #ifdef around forward declaration |
Upgrading inlined code to virtual methods for register scavenger so that subclasses could override behavior Signed-off-by: Lin Hu <linhu@ca.ibm.com>
jenkins build zlinux(cmake:'-DOMR_GC_MODRON_SCAVENGER=OFF') |
zLinux PR build with jenkins build all |
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.
https://ci.eclipse.org/omr/job/PullRequest-linux_ppc-64_le_gcc/3855/console
Known failure: #6571
All other PR builds passed successfully.
Upgrading inlined code to virtual methods for register scavenger
so that subclasses could override behavior.
Signed-off-by: Lin Hu linhu@ca.ibm.com