RFR: 8329750: Change Universe functions to return more specific Klass* types [v2]

Coleen Phillimore coleenp at openjdk.org
Mon Apr 8 13:33:11 UTC 2024


On Mon, 8 Apr 2024 07:16:11 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> We have various functions in Universe that returns Klass* where they could be returning TypeArrayKlass* and ObjArrayKlass* instead. If we change these functions we could get rid of some casts in the code. Does this seem like a reasonable change?
>
> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update src/hotspot/share/classfile/systemDictionary.cpp
>   
>   Dean's suggestion
>   
>   Co-authored-by: Dean Long <17332032+dean-long at users.noreply.github.com>

This change just makes it confusing and doesn't add anything.  If array_klass changed more, then not sure what to do with these lines.

src/hotspot/share/classfile/systemDictionary.cpp line 372:

> 370:     TypeArrayKlass* tak = Universe::typeArrayKlass(t);
> 371:     k = tak->array_klass(ndims, CHECK_NULL);
> 372:     k = k->array_klass(ndims, CHECK_NULL);

this looks puzzling.  Why are there two array_klass calls now?  Add short comments to explain.

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

Changes requested by coleenp (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/18652#pullrequestreview-1986444877
PR Review Comment: https://git.openjdk.org/jdk/pull/18652#discussion_r1555840081


More information about the graal-dev mailing list