RFR: 8366584: Add an InstanceKlass::super() method that returns InstanceKlass* [v3]

Coleen Phillimore coleenp at openjdk.org
Wed Sep 3 11:41:44 UTC 2025


On Tue, 2 Sep 2025 21:08:25 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> By adding an `InstanceKlass* InstanceKlass::super()` method to shadow `Klass* Klass:super()`, this PR makes it possible to simplify the following code
>> 
>> 
>> InstanceKlass* ik;
>> InstanceKlass* s;
>> s = InstanceKlass::cast(ik->super()); // before JDK-8366024 
>> s = ik->java_super(); // after JDK-8366024 
>> 
>> 
>> to
>> 
>> 
>> s = k->super();
>> 
>> 
>> So you no longer need to do casting or need to understand what `java_super()` is.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
> 
>   @dholmes-ora and @coleep comments

Looks good.  This will help with InstanceKlass casting.

-------------

Marked as reviewed by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27037#pullrequestreview-3180231376


More information about the serviceability-dev mailing list