-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8316150: Refactor get chars and string size #15699
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
8316150: Refactor get chars and string size #15699
Conversation
|
👋 Welcome back wenshao! A progress list of the required criteria for merging this PR into |
|
@wenshao The following labels will be automatically applied to this pull request:
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. |
Webrevs
|
|
@cl4es can you help me to review this PR? |
|
/reviewers 2 |
|
@AlanBateman |
|
/label remove i18n |
|
@wenshao |
|
/label remove hotspot-compiler |
|
@wenshao |
|
There's a lot of duplication exposed here between the We also should keep HexDigits and OctalDigits classes have a consistent API and functionality. |
|
@wenshao this pull request can not be integrated into git checkout refactor_get_chars_and_string_size
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 |
…s_and_string_size # Conflicts: # src/java.base/share/classes/java/lang/StringLatin1.java
…vides two implementations: prependLatin1 and prependUTF16
…vides two implementations: prependLatin1 and prependUTF16 [v2]
|
Since the current // A replacement for setter MethodHandle, or VarHandle, to accept multiple value types
public interface DigitConsumer {
void putChar(byte[] array, int index, byte value);
// put 2 byte-sized chars at once, encoded little endian
void putChar2(byte[] array, int index, short value);
// you can add putChar4, putChar8, etc. if you need
}and Currently, you are allocating a new byte array for every number in the format, which I deem very inefficient. |
Code based on MethodHandler is difficult to maintain and debug. We should remove the use of MethodHandle in FormatItem. |
ExE-Boss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The throws Throwable declarations are no longer needed, as the prependers no longer depend on MethodHandles.
|
You could benefit from compiling and testing in your repo before committing; it would cut down on the spurious changes. |
|
There are too many changes that need to be made to reduce the duplication of code in the digits method and the getCharsLatin1. Can we temporarily allow duplicate code for digits and getCharLatin1? Revert changes related to FormatItem. After this PR is completed, submit a new PR to change FormatItem and reduce duplicate code. |
Changes related to FormatItem have been reverted because too many changes were made. The duplicate code of getChars and digits will be solved with another PR later. |
|
/reviewers 2 reviewer |
|
@AlanBateman |
|
@wenshao This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@wenshao This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
Progress
Integration blocker
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15699/head:pull/15699$ git checkout pull/15699Update a local copy of the PR:
$ git checkout pull/15699$ git pull https://git.openjdk.org/jdk.git pull/15699/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15699View PR using the GUI difftool:
$ git pr show -t 15699Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15699.diff
Webrev
Link to Webrev Comment