Skip to content

Conversation

@shipilev
Copy link
Member

@shipilev shipilev commented Jul 10, 2024

All around Hotspot, we have calls to method->is_initializer(). That method tests for both instance and static initializers. In many cases, the uses imply we actually want to test for constructor, not static initializer. Sometimes we filter explicitly for !m->is_static(), sometimes we don't. At this point, I think the best way to prevent future accidents is to remove the confusing is_initializer.

The behavioral changes have been handled by already integrated PRs, see the links in JBS. The changes left here are not (supposed to be) changing the behavior.


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

  • JDK-8336103: Clean up confusing Method::is_initializer (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20120

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 10, 2024

👋 Welcome back shade! 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
Copy link

openjdk bot commented Jul 10, 2024

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

8336103: Clean up confusing Method::is_initializer

Reviewed-by: dholmes, coleenp

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 251 new commits pushed to the master branch:

  • 2c0c653: 8342044: Increase timeout of gc/shenandoah/oom/TestClassLoaderLeak.java
  • df7d6e0: 8338603: DiagnosticCommandMBean operations should standardize types for parameters
  • c9a536c: 8337339: gc/arguments/Test*SizeFlags.java timing out with Xcomp
  • f4dccfd: 8338596: Clarify handling of restricted and caller-sensitive methods
  • 3b8a2f8: 8337269: G1ConfidencePercent interpreted inconsistently
  • 521effe: 8340189: 8339531 incorrect for Big Endian platforms
  • e6698f5: 8337851: Some tests have name which confuse jtreg
  • a601cd2: 8342014: RISC-V: ZStoreBarrierStubC2 clobbers rflags
  • bd62644: 8341924: Improve error message with structurally malformed Code array
  • a2c7752: 8317356: Fix missing null checks in the ClassFile API
  • ... and 241 more: https://git.openjdk.org/jdk/compare/1447967f53fe27f67e4bb766464f941e39506d41...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this 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 rfr Pull request is ready for review label Jul 10, 2024
@openjdk
Copy link

openjdk bot commented Jul 10, 2024

@shipilev The following labels will be automatically applied to this pull request:

  • graal
  • hotspot

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

@openjdk openjdk bot added graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Jul 10, 2024
@shipilev
Copy link
Member Author

Caught some test failures, back to draft.

@shipilev shipilev marked this pull request as draft July 10, 2024 17:18
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jul 10, 2024
@shipilev shipilev marked this pull request as ready for review July 11, 2024 08:42
@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 11, 2024
@mlbridge
Copy link

mlbridge bot commented Jul 11, 2024

Webrevs

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.

It is evident that people have been unfamiliar/sloppy with this API. This change should help prevent that in future. I have a concern about one change.

Thanks

@shipilev
Copy link
Member Author

shipilev commented Jul 16, 2024

Putting back to draft until the behavioral changes are done in separate sub-tasks.

@shipilev shipilev marked this pull request as draft July 16, 2024 11:35
@openjdk openjdk bot removed the rfr Pull request is ready for review label Jul 16, 2024
@openjdk
Copy link

openjdk bot commented Aug 15, 2024

@shipilev this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8336103-is-initializer-checks
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Aug 15, 2024
@shipilev shipilev changed the title 8336103: Sharper checks for <init> and <clinit> initializers 8336103: Clean up confusing Method::is_initializer Sep 26, 2024
@shipilev shipilev force-pushed the JDK-8336103-is-initializer-checks branch from a18f7a4 to b6653e6 Compare September 26, 2024 18:42
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Sep 26, 2024
@shipilev shipilev marked this pull request as ready for review September 27, 2024 09:52
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 27, 2024
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.

This looks good.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 27, 2024
@shipilev
Copy link
Member Author

shipilev commented Oct 6, 2024

Thank you! I think I need another formal Reviewer comment before I can integrate.

@shipilev
Copy link
Member Author

@dholmes-ora -- maybe you want to sanity check this again?

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.

Simplified version looks good. Sorry I didn't spot this had been updated.

@shipilev
Copy link
Member Author

Thank you!

/integrate

@openjdk
Copy link

openjdk bot commented Oct 15, 2024

Going to push as commit 54c9348.
Since your change was applied there have been 251 commits pushed to the master branch:

  • 2c0c653: 8342044: Increase timeout of gc/shenandoah/oom/TestClassLoaderLeak.java
  • df7d6e0: 8338603: DiagnosticCommandMBean operations should standardize types for parameters
  • c9a536c: 8337339: gc/arguments/Test*SizeFlags.java timing out with Xcomp
  • f4dccfd: 8338596: Clarify handling of restricted and caller-sensitive methods
  • 3b8a2f8: 8337269: G1ConfidencePercent interpreted inconsistently
  • 521effe: 8340189: 8339531 incorrect for Big Endian platforms
  • e6698f5: 8337851: Some tests have name which confuse jtreg
  • a601cd2: 8342014: RISC-V: ZStoreBarrierStubC2 clobbers rflags
  • bd62644: 8341924: Improve error message with structurally malformed Code array
  • a2c7752: 8317356: Fix missing null checks in the ClassFile API
  • ... and 241 more: https://git.openjdk.org/jdk/compare/1447967f53fe27f67e4bb766464f941e39506d41...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 15, 2024

@shipilev Pushed as commit 54c9348.

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

@shipilev shipilev deleted the JDK-8336103-is-initializer-checks branch January 8, 2025 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants