Skip to content

Conversation

@wenshao
Copy link

@wenshao wenshao commented Oct 31, 2025

Through JVM Option +PrintInlining, we found that String has a constructor codeSize of 852, which is too large. This caused failed to inline.

The following is the output information of PrintInlining:

                @ 9   java.lang.String::<init> (12 bytes)   inline (hot)
!m                 @ 1   java.nio.charset.Charset::defaultCharset (52 bytes)   inline (hot)
!                  @ 8   java.lang.String::<init> (852 bytes)   failed to inline: hot method too big

In Java code, the big method that cannot be inlined is the following constructor

String(Charset charset, byte[] bytes, int offset, int length) {}

The above String constructor is too large; break it down into smaller methods with a codeSize under 325 to allow them to be inlined by the C2.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8357289 needs maintainer approval

Issue

  • JDK-8357289: Break down the String constructor into smaller methods (Enhancement - P4 - Requested)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 351

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk25u/pull/351.diff

Using Webrev

Link to Webrev Comment

@wenshao
Copy link
Author

wenshao commented Oct 31, 2025

/label add backport

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 31, 2025

👋 Welcome back swen! 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 Oct 31, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 31, 2025
@openjdk
Copy link

openjdk bot commented Oct 31, 2025

@wenshao
The label backport is not a valid label.
These labels are valid:

@mlbridge
Copy link

mlbridge bot commented Oct 31, 2025

Webrevs

@openjdk
Copy link

openjdk bot commented Oct 31, 2025

@wenshao Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

@wenshao
Copy link
Author

wenshao commented Oct 31, 2025

/label add backport

@openjdk
Copy link

openjdk bot commented Oct 31, 2025

@wenshao
The label backport is not a valid label.
These labels are valid:

@wenshao wenshao changed the title 8357289: Break down the String constructor into smaller methods Backport 839cede1a46b05d27abeaffbbd82c241910035cd Oct 31, 2025
@openjdk openjdk bot changed the title Backport 839cede1a46b05d27abeaffbbd82c241910035cd 8357289: Break down the String constructor into smaller methods Oct 31, 2025
@openjdk
Copy link

openjdk bot commented Oct 31, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Oct 31, 2025
@openjdk
Copy link

openjdk bot commented Oct 31, 2025

⚠️ @wenshao This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@wenshao
Copy link
Author

wenshao commented Oct 31, 2025

/approval

@openjdk
Copy link

openjdk bot commented Oct 31, 2025

@wenshao usage: /approval [<id>] (request|cancel) [<text>]

@wenshao
Copy link
Author

wenshao commented Oct 31, 2025

/approval 8357289 request speed up new String from bytes

@openjdk
Copy link

openjdk bot commented Oct 31, 2025

@wenshao
8357289: The approval request has been created successfully.

@openjdk openjdk bot added the approval Requires approval; will be removed when approval is received label Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval Requires approval; will be removed when approval is received backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant