On Thu, 20 Nov 2025 23:33:30 GMT, Vladimir Ivanov <[email protected]> wrote:
>> 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.)
Yes that looks better. There aren't enough {} in that bit of code but I won't
add more to existing code. Thanks for your help with the C2 code.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28371#discussion_r2549873241