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

JDK-8301460: Clean up LambdaForm to reference BasicType enums directly #12546

Closed
wants to merge 3 commits into from

Conversation

mlchung
Copy link
Member

@mlchung mlchung commented Feb 13, 2023

LambdaForm declares int constants for BasicType::ordinal to workaround JDK-8161245. Now these int constants are no longer needed. This removes these int constants and reference BasicType enums directly.


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-8301460: Clean up LambdaForm to reference BasicType enums directly

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 12546

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Feb 13, 2023

👋 Welcome back mchung! 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 Feb 13, 2023
@openjdk
Copy link

openjdk bot commented Feb 13, 2023

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Feb 13, 2023
@mlbridge
Copy link

mlbridge bot commented Feb 13, 2023

Webrevs

Comment on lines 364 to 371
SpeciesData extendWith(BasicType basicType) {
int typeNum = basicType.ordinal();
SpeciesData sd = extensions[typeNum];
if (sd != null) return sd;
sd = SPECIALIZER.findSpecies(key() + basicType.basicTypeChar());
extensions[typeNum] = sd;
return sd;
}
Copy link
Member

Choose a reason for hiding this comment

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

I suggest changing the existing overload to delegate to this one with BasicType.basicType(typeNum) as the argument. (or to use some other way to reduce the duplication)

Copy link
Member Author

Choose a reason for hiding this comment

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

I further cleaned this up. extendWith(byte typeNum) is now removed.

int typeNum = basicType.ordinal();
SpeciesData sd = extensions[typeNum];
if (sd != null) return sd;
sd = SPECIALIZER.findSpecies(key() + basicType.basicTypeChar());
Copy link
Contributor

Choose a reason for hiding this comment

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

As soon as this is java.base I suggest to replace key() + basicType.basicTypeChar() with key().concat(String.valueOf(basicType.basicTypeChar())) to prevent StringBuilder allocation and append() chaining.

Copy link
Member Author

Choose a reason for hiding this comment

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

There are only 5 elements in extensions arrays for 5 BasicType. I don't think this overhead is significant.

@openjdk
Copy link

openjdk bot commented Feb 14, 2023

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

8301460: Clean up LambdaForm to reference BasicType enums directly

Reviewed-by: jvernee

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

  • 9c202a5: 8302260: VarHandle.describeConstable() fails to return a nominal descriptor for static public fields
  • ca73f7e: 8301374: NullPointerException in MemberEnter.checkReceiver

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 ready Pull request is ready to be integrated label Feb 14, 2023
@mlchung
Copy link
Member Author

mlchung commented Feb 15, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Feb 15, 2023

Going to push as commit 50dcc2a.
Since your change was applied there have been 14 commits pushed to the master branch:

  • 28f5250: 8302127: Remove unused arg in write_ref_field_post
  • 0c96584: 8301225: Replace NULL with nullptr in share/gc/shenandoah/
  • 26b111d: 8301700: Increase the default TLS Diffie-Hellman group size from 1024-bit to 2048-bit
  • 5238817: 8301463: Code in DatagramSocket still refers to resolved JDK-8237352
  • 11194e8: 8302325: Wrong comment in java.base/share/native/libjimage/imageFile.hpp
  • 33bec20: 8300808: Accelerate Base64 on x86 for AVX2
  • 46bcc49: 8302147: Speed up compiler/jvmci/compilerToVM/IterateFramesNative.java
  • a9a53f4: 8302152: Speed up tests with infinite loops, sleep less
  • 98a392c: 8302102: Disable ASan for SafeFetch and os::print_hex_dump
  • 9ccf8ad: 8302129: Make MetaspaceReclaimPolicy a diagnostic switch
  • ... and 4 more: https://git.openjdk.org/jdk/compare/5b2d430131e8e5f6e91d449dab84b99ef6f1c880...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Feb 15, 2023

@mlchung Pushed as commit 50dcc2a.

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

@mlchung mlchung deleted the JDK-8301460 branch August 2, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
3 participants