On Wed, 19 Nov 2025 12:34:30 GMT, Coleen Phillimore <[email protected]> wrote:
>> 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.
>
> Coleen Phillimore has updated the pull request incrementally with one
> additional commit since the last revision:
>
> Revert a couple more InstanceKlass::casts also to get GHA to restart.
src/hotspot/share/opto/compile.cpp line 1729:
> 1727: if (flat->offset() ==
> in_bytes(Klass::super_check_offset_offset()))
> 1728: alias_type(idx)->set_rewritable(false);
> 1729: if (flat->isa_instklassptr() && flat->offset() ==
> in_bytes(InstanceKlass::access_flags_offset()))
I'd place the check separately. Otherwise, looks good.
diff --git a/src/hotspot/share/opto/compile.cpp
b/src/hotspot/share/opto/compile.cpp
index 6babc13e1b3..9215c0fc03f 100644
--- a/src/hotspot/share/opto/compile.cpp
+++ b/src/hotspot/share/opto/compile.cpp
@@ -1726,8 +1726,6 @@ Compile::AliasType* Compile::find_alias_type(const
TypePtr* adr_type, bool no_cr
}
if (flat->offset() == in_bytes(Klass::super_check_offset_offset()))
alias_type(idx)->set_rewritable(false);
- if (flat->offset() == in_bytes(Klass::access_flags_offset()))
- alias_type(idx)->set_rewritable(false);
if (flat->offset() == in_bytes(Klass::misc_flags_offset()))
alias_type(idx)->set_rewritable(false);
if (flat->offset() == in_bytes(Klass::java_mirror_offset()))
@@ -1735,6 +1733,11 @@ Compile::AliasType* Compile::find_alias_type(const
TypePtr* adr_type, bool no_cr
if (flat->offset() == in_bytes(Klass::secondary_super_cache_offset()))
alias_type(idx)->set_rewritable(false);
}
+ if (flat->isa_instklassptr()) {
+ if (flat->offset() == in_bytes(InstanceKlass::access_flags_offset())) {
+ alias_type(idx)->set_rewritable(false);
+ }
+ }
// %%% (We would like to finalize JavaThread::threadObj_offset(),
// but the base pointer type is not distinctive enough to identify
// references into JavaThread.)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2548046511