-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8308603: Removing do_pending_ref/enclosing_ref from MetaspaceClosure #14093
8308603: Removing do_pending_ref/enclosing_ref from MetaspaceClosure #14093
Conversation
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
Webrevs
|
} | ||
|
||
// We are dealing with 3 addresses: | ||
// address o = ref->obj(): We have found an object whose address is o. |
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.
Are 'obj' oops ? We almost always refer to oops as obj but not other things. Is 'object' an oop? This operates on metadata right? I realize this terminology is pre-existing. I suggest changing obj and object in comments at least in the new code to either metadata() or ptr() even, metaptr() ? Unless this does move oops. I don't know this code.
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.
All the "objects" in the code related to MetaspaceClosure refer to instances of MetaspaceObj. This code rarely interacts with code that work on oops, so there isn't much confusion in practice.
I'd rather not change part of the code or comments to use a different name than "object". I think that will be even more confusing, causing the reader to think that "metadata", for example, is materially different than "object".
Also, "metadata" is unfortunately not a good name, because not every MetaspaceObj is a Metadata.
If renaming is desirable, that should be done in a separate RFE.
@iklam This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Thanks @calvinccheung for the review. |
Going to push as commit 16c3d53.
Your commit was automatically rebased without conflicts. |
The problem
MetaspaceClosure is used to traverse all pointers in the metaspace objects. It works recursively. A pointer is represented by the
MetaspaceClosure::Ref
type. For example, if you haveWhen we are traversing the pointer
a->_super
, we create aRef
that records the address ofb
and&a->super
. However, we currently don't remember the address ofa
in theRef
. As a result, when processing theRef
inside apush(Ref* ref)
function, we need to callMetaspaceClosure::enclousing_ref()
to get toa
, so that we can mark pointers inside it.The reason for
do_pending_ref
is even more convoluted. Please see JDK-8308603 for more details.The fix
The code can be much more readable if we simply remember
a
in theRef
.More info
A more in-depth discussion of the use of the MetaspaceClosure API in CDS can be found at:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14093/head:pull/14093
$ git checkout pull/14093
Update a local copy of the PR:
$ git checkout pull/14093
$ git pull https://git.openjdk.org/jdk.git pull/14093/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14093
View PR using the GUI difftool:
$ git pr show -t 14093
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14093.diff
Webrev
Link to Webrev Comment