Skip to content
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

8292891: ifdef-out some CDS-only functions #10010

Closed

Conversation

iklam
Copy link
Member

@iklam iklam commented Aug 24, 2022

Some CDS functions are always compiled, even when CDS is not enabled (e.g., for the minimal VM).

This RFE puts some of the obvious ones inside #if INCLUDE_CDS blocks.

Note: my goal is not to make the minimal VM as small as possible. But rather, I don't want to put #if INCLUDE_CDS inside each of those functions that access a CDS-only feature. (E.g., ConstantPoolCache::save_for_archive, which accesses _initial_entries, which is declared only when CDS is enabled).


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10010/head:pull/10010
$ git checkout pull/10010

Update a local copy of the PR:
$ git checkout pull/10010
$ git pull https://git.openjdk.org/jdk pull/10010/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10010

View PR using the GUI difftool:
$ git pr show -t 10010

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10010.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 24, 2022

👋 Welcome back iklam! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 24, 2022
Copy link
Contributor

@coleenp coleenp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to have the largest if blocks possible.

@openjdk
Copy link

openjdk bot commented Aug 24, 2022

@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:

8292891: ifdef-out some CDS-only functions

Reviewed-by: coleenp, ccheung, dholmes

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 master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Aug 24, 2022
@openjdk
Copy link

openjdk bot commented Aug 24, 2022

@iklam The following label will be automatically applied to this pull request:

  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot hotspot-dev@openjdk.org label Aug 24, 2022
@mlbridge
Copy link

mlbridge bot commented Aug 24, 2022

Webrevs

Copy link
Member

@calvinccheung calvinccheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup. One comment below.

@@ -401,6 +401,7 @@ void Method::metaspace_pointers_do(MetaspaceClosure* it) {
NOT_PRODUCT(it->push(&_name);)
}

#if INCLUDE_CDS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to ifdef out the declaration in method.hpp?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I also found out that Method::restore_unshareable_info also needed to be ifdef'ed out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates look good.

@@ -569,6 +572,7 @@ class Klass : public Metadata {
return true;
}
}
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add an // INCLUDE_CDS here? If they're more than 10 lines apart, uncommented endifs can be really confusing. This one is sort of borderline far away. Thanks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a slippery slope. We have things like NOT_CDS_RETURN to avoid the need to use ifdef INCLUDE_CDS at the callsites. If you now ifdef the call sites you don't need NOT_CDS_RETURN. Conversely if you are still using NOT_CDS_RETURN then why didn't you ifdef the callsites?

Comment on lines 137 to 138
void remove_unshareable_info() NOT_CDS_RETURN;
void restore_unshareable_info(TRAPS) NOT_CDS_RETURN;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely these should ifdef'd out not stubbed out? The callers of these should also be in INCLUDE_CDS blocks.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates.

@iklam
Copy link
Member Author

iklam commented Aug 29, 2022

Thanks @calvinccheung @coleenp @dholmes-ora for the review!
/integrate

@openjdk
Copy link

openjdk bot commented Aug 29, 2022

Going to push as commit 40b0ed5.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 29, 2022
@openjdk openjdk bot closed this Aug 29, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Aug 29, 2022
@openjdk
Copy link

openjdk bot commented Aug 29, 2022

@iklam Pushed as commit 40b0ed5.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

4 participants