On Wed, 24 Jul 2024 09:03:12 GMT, Andrew Haley <a...@openjdk.org> wrote:

>>> Also also, Klass::is_subtype_of() is used for C1 runtime.
>> 
>> Can you elaborate, please? What I'm seeing in 
>> `Runtime1::generate_code_for()` for `slow_subtype_check` is a call into 
>> `MacroAssembler::check_klass_subtype_slow_path()`.
>
>> > Also also, Klass::is_subtype_of() is used for C1 runtime.
>> 
>> Can you elaborate, please?
> 
> Sorry, that was rather vague. In C1-compiled code, the Java method 
> `Class::isInstance(Object)`calls `Klass::is_subtype_of()`. 
> 
> In general, I find it difficult to decide how much work, if any, should be 
> done to improve C1 performance. Clearly, if C1 exists only to help with 
> startup time in a tiered compilation system, the answer is "not much".

Thanks, now I see that `Class::isInstance(Object)` is backed by 
`Runtime1::is_instance_of()` which uses `oopDesc::is_a()` to do the job.

If it turns out to be performance critical, the intrinsic implementation should 
be rewritten to exercise existing subtype checking support in C1. As it is 
implemented now, it's already quite inefficient.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19989#discussion_r1690303731

Reply via email to