Skip to content

Conversation

@cl4es
Copy link
Member

@cl4es cl4es commented May 18, 2021

Using a switch expression instead of a (read-only) static HashMap reduces initialization overhead of VarHandle$AccessMode. This gets loaded earlier after JDK-8265079, so it started showing up in a few lambda startup tests.

This also obsoletes a jtreg test that only verified that this map was optimally sized.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8267321: Use switch expression for VarHandle$AccessMode lookup

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4102/head:pull/4102
$ git checkout pull/4102

Update a local copy of the PR:
$ git checkout pull/4102
$ git pull https://git.openjdk.java.net/jdk pull/4102/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4102

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4102.diff

@bridgekeeper
Copy link

bridgekeeper bot commented May 18, 2021

👋 Welcome back redestad! 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 May 18, 2021
@openjdk
Copy link

openjdk bot commented May 18, 2021

@cl4es 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 May 18, 2021
@mlbridge
Copy link

mlbridge bot commented May 18, 2021

Webrevs

Copy link
Member

@JornVernee JornVernee left a comment

Choose a reason for hiding this comment

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

LGTM. I assume existing tests verify that all values of the enum are covered by the switch?

@openjdk
Copy link

openjdk bot commented May 19, 2021

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

8267321: Use switch expression for VarHandle$AccessMode lookup

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

  • fdd0352: 8267338: [JVMCI] revive JVMCI API removed by JDK-8243287
  • 0b49f5a: 8267257: Shenandoah: Always deduplicate strings when it is enabled during full gc
  • 12050f0: 8266651: Convert Table method parameters from String to Content
  • e749f75: 8267304: Bump global JTReg memory limit to 768m
  • e858dd6: 8267361: JavaTokenizer reads octal numbers mistakenly
  • 1b93b81: 8267133: jdk/jfr/event/gc/collection/TestG1ParallelPhases.java fails with Not expected phases: RestorePreservedMarks, RemoveSelfForwardingPtr: expected true, was false
  • 88b1142: 8267357: build breaks with -Werror option on micro benchmark added for JDK-8256973
  • 6ef46ce: 8231672: Simplify the reference processing parallelization framework
  • 392f962: 8267151: C2: Don't create dummy Opaque1Node for outmost unswitched IfNode
  • 0cf7e57: 8267239: C1: RangeCheckElimination for % operator if divisor is IntConstant
  • ... and 20 more: https://git.openjdk.java.net/jdk/compare/894547d2c102dcbe1f9ec8a1edb11c6b31e4270e...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 ready Pull request is ready to be integrated label May 19, 2021
@cl4es
Copy link
Member Author

cl4es commented May 19, 2021

LGTM. I assume existing tests verify that all values of the enum are covered by the switch?

Thanks! Yes, the method with the switch is called when linking a VH, and the tests should be exhaustive in that regard.

@cl4es
Copy link
Member Author

cl4es commented May 19, 2021

/integrate

@openjdk openjdk bot closed this May 19, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 19, 2021
@openjdk
Copy link

openjdk bot commented May 19, 2021

@cl4es Since your change was applied there have been 30 commits pushed to the master branch:

  • fdd0352: 8267338: [JVMCI] revive JVMCI API removed by JDK-8243287
  • 0b49f5a: 8267257: Shenandoah: Always deduplicate strings when it is enabled during full gc
  • 12050f0: 8266651: Convert Table method parameters from String to Content
  • e749f75: 8267304: Bump global JTReg memory limit to 768m
  • e858dd6: 8267361: JavaTokenizer reads octal numbers mistakenly
  • 1b93b81: 8267133: jdk/jfr/event/gc/collection/TestG1ParallelPhases.java fails with Not expected phases: RestorePreservedMarks, RemoveSelfForwardingPtr: expected true, was false
  • 88b1142: 8267357: build breaks with -Werror option on micro benchmark added for JDK-8256973
  • 6ef46ce: 8231672: Simplify the reference processing parallelization framework
  • 392f962: 8267151: C2: Don't create dummy Opaque1Node for outmost unswitched IfNode
  • 0cf7e57: 8267239: C1: RangeCheckElimination for % operator if divisor is IntConstant
  • ... and 20 more: https://git.openjdk.java.net/jdk/compare/894547d2c102dcbe1f9ec8a1edb11c6b31e4270e...master

Your commit was automatically rebased without conflicts.

Pushed as commit 9760dba.

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

@cl4es cl4es deleted the vhaccessmodes branch May 19, 2021 15:24
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

Development

Successfully merging this pull request may close these issues.

2 participants