jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8373633: C2: Use interface receiver type to improve CHA decisions

Open iwanowww opened this issue 1 month ago • 5 comments

Strength-reducing an interface call to a virtual call for interfaces with unique implementors can use receiver type information to narrow the context.

C2 tracks interface types and receiver type information can be used to reveal an interface with a unique implementor which can't be derived from the call site itself.

Since C2 effectively accumulates a union interface type from multiple subtype checks, iterating over individual components of a type may reveal a candidate for a strength-reduction. The only prerequisite is that a candidate has to be a subtype of the declared interface.

Testing: hs-tier1 - hs-tier5


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8373633: C2: Use interface receiver type to improve CHA decisions (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28811

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

Using diff file

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

Using Webrev

Link to Webrev Comment

iwanowww avatar Dec 13 '25 02:12 iwanowww

:wave: Welcome back vlivanov! 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.

bridgekeeper[bot] avatar Dec 13 '25 02:12 bridgekeeper[bot]

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

openjdk[bot] avatar Dec 13 '25 02:12 openjdk[bot]

@iwanowww this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout cha.intf.recv
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

openjdk[bot] avatar Dec 13 '25 02:12 openjdk[bot]

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

  • hotspot-compiler

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[bot] avatar Dec 13 '25 02:12 openjdk[bot]

Webrevs

mlbridge[bot] avatar Dec 13 '25 02:12 mlbridge[bot]