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

8271732: Regression in StringBuilder.charAt bounds checking #5086

Closed
wants to merge 5 commits into from

Conversation

cl4es
Copy link
Member

@cl4es cl4es commented Aug 11, 2021

In #4738 we removed the checkIndex(value, count) call in ASB.charAt to avoid potentially getting two bounds checks in the UTF-16 case. Problem is this optimization cause a regression since StringUTF16.charAt(..) checks index against the length of the value array and not count.

A correct fix that still maintain the possible performance advantage reported by #4738 is to reinstate the checkIndex(value, count) and call StringUTF16.getChar instead of charAt.


Progress

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

Issue

  • JDK-8271732: Regression in StringBuilder.charAt bounds checking

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5086

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 11, 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 label Aug 11, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 11, 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 label Aug 11, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Aug 11, 2021

Webrevs

Copy link
Contributor

@AlanBateman AlanBateman left a comment

This looks okay but surprised there wasn't a jtreg test that would have caught this before integration, maybe we should add a test as part of this change.

@openjdk
Copy link

@openjdk openjdk bot commented Aug 11, 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:

8271732: Regression in StringBuilder.charAt bounds checking

Reviewed-by: alanb, naoto

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

  • ec2fc38: 8272120: Avoid looking for standard encodings in "java." modules
  • bd27bb9: 8272345: macos doesn't check os::set_boot_path() result
  • 44f137f: 8271170: Add unit test for what jpackage app launcher puts in the environment
  • cd2dbe5: 8272328: java.library.path is not set properly by Windows jpackage app launcher
  • 9faab40: 8272330: C2: Cleanup profile counter scaling
  • 75a0642: 8272335: runtime/cds/appcds/MoveJDKTest.java doesn't check exit codes
  • 9ba8a12: 8269774: doclint reports missing javadoc comments for JavaFX properties if the docs are on the property method
  • ec8d3ba: 8271159: [REDO] JDK-8249634 doclint should report implicit constructor as missing javadoc comments
  • 6194227: 8272228: G1: G1CardSetInlinePtr Fix tautological assertion

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 label Aug 11, 2021
naotoj
naotoj approved these changes Aug 11, 2021
Copy link
Member

@naotoj naotoj left a comment

LGTM.

naotoj
Copy link
Member

@naotoj naotoj commented on e29c576 Aug 11, 2021

Choose a reason for hiding this comment

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

Would you want to also test non-Latin1, just in case?

naotoj
naotoj approved these changes Aug 11, 2021
@cl4es
Copy link
Member Author

@cl4es cl4es commented Aug 12, 2021

/integrate

@openjdk
Copy link

@openjdk openjdk bot commented Aug 12, 2021

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

  • ec2fc38: 8272120: Avoid looking for standard encodings in "java." modules
  • bd27bb9: 8272345: macos doesn't check os::set_boot_path() result
  • 44f137f: 8271170: Add unit test for what jpackage app launcher puts in the environment
  • cd2dbe5: 8272328: java.library.path is not set properly by Windows jpackage app launcher
  • 9faab40: 8272330: C2: Cleanup profile counter scaling
  • 75a0642: 8272335: runtime/cds/appcds/MoveJDKTest.java doesn't check exit codes
  • 9ba8a12: 8269774: doclint reports missing javadoc comments for JavaFX properties if the docs are on the property method
  • ec8d3ba: 8271159: [REDO] JDK-8249634 doclint should report implicit constructor as missing javadoc comments
  • 6194227: 8272228: G1: G1CardSetInlinePtr Fix tautological assertion

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Aug 12, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Aug 12, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 12, 2021

@cl4es Pushed as commit a15b659.

💡 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
core-libs integrated
3 participants