Skip to content

Conversation

@coleenp
Copy link
Contributor

@coleenp coleenp commented Nov 18, 2025

ArrayKlass doesn't set AccessFlags so don't look for them there. See CR for details.
Fixed SA and jvmci. @iwanowww Can you check that I changed C2 correctly (we talked about this in August).
Tested with tier1-4. 5-7 in progress.


Progress

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

Issue

  • JDK-8372098: Move AccessFlags to InstanceKlass (Enhancement - P4)

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 28371

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 18, 2025

👋 Welcome back coleenp! 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 Nov 18, 2025

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

@openjdk openjdk bot added graal graal-dev@openjdk.org serviceability serviceability-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Nov 18, 2025
@openjdk
Copy link

openjdk bot commented Nov 18, 2025

@coleenp The following labels will be automatically applied to this pull request:

  • graal
  • hotspot
  • serviceability

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.

}

// Check constant pool method consistency
InstanceKlass* callee = InstanceKlass::cast(k);
Copy link
Member

Choose a reason for hiding this comment

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

I know a MethodRef can be [I, clone, ()Ljava/lang/Object; for intArray.clone() Java calls translated by javac. I wonder if this new code would break for such an array callee class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At one point, I removed is_interface() from class Klass, but then restored it because dependencies uses this a lot and has many Klass parameter types, instead of InstanceKlass. I'll revert this change, but I'm curious why none of the tests failed with this change.

@coleenp coleenp changed the title Move AccessFlags to InstanceKlass 8372098: Move AccessFlags to InstanceKlass Nov 18, 2025
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 18, 2025
@mlbridge
Copy link

mlbridge bot commented Nov 18, 2025

Webrevs

interface_index, CHECK);
if (cp->tag_at(interface_index).is_klass()) {
interf = cp->resolved_klass_at(interface_index);
interf = InstanceKlass::cast(cp->resolved_klass_at(interface_index));

Choose a reason for hiding this comment

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

Note that a resolved CONSTANT_Class can refer to an array type, so this cast is incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are a bunch of tests that we don't have. This would be an error since Interfaces are never arrays, but that's checked later. I'll revert some of these casts (as well as try to write a test for this).

Copy link
Member

Choose a reason for hiding this comment

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

I thought the cast at line 839 would have handled this. Turns out it has a !interf->is_interface() check before so this cast is problematic.

Copy link
Contributor Author

@coleenp coleenp Nov 18, 2025

Choose a reason for hiding this comment

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

There's a reason this isn't tested. The constant pool reference for JVM_CONSTANT_Class is tested to be resolved at line 814 and because it's an interface, it's not easy to be resolved by this point (unless it's a duplicate class in which case it will be an InstanceKlass). The array case goes through the else part of this and throws a ClassFormatError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org rfr Pull request is ready for review serviceability serviceability-dev@openjdk.org

Development

Successfully merging this pull request may close these issues.

3 participants