Integrated: 8367142: Avoid InstanceKlass::cast when converting java mirror to InstanceKlass

Ioi Lam iklam at openjdk.org
Tue Sep 16 01:08:36 UTC 2025


On Tue, 9 Sep 2025 05:21:10 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> The purpose of this PR is to simplify JNI code and also to avoid unnecessary `InstanceKlass::cast()` calls by adding a new  function:
> 
> 
> static InstanceKlass* java_lang_Class::as_InstanceKlass(oop java_class);
> 
> 
> This PR is intended to be a strict clean-up that preserves existing behaviors.

This pull request has now been integrated.

Changeset: 24255848
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/242558484985cb954b0e658776fd59cbca1be1db
Stats:     110 lines in 15 files changed: 9 ins; 30 del; 71 mod

8367142: Avoid InstanceKlass::cast when converting java mirror to InstanceKlass

Reviewed-by: dholmes, coleenp

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

PR: https://git.openjdk.org/jdk/pull/27158


More information about the serviceability-dev mailing list