RFR: 8357987: [JVMCI] Add Support for Retrieving All Non-Static Methods of a ResolvedJavaType.

Doug Simon dnsimon at openjdk.org
Fri May 30 15:06:09 UTC 2025


On Thu, 29 May 2025 06:56:18 GMT, Tom Shull <duke at openjdk.org> wrote:

>> I realized NonStatic is not accurate - we return everything except `<init>s` and `<clinit>` - so I switched to `NonInitializerMethods` everywhere. Does that seem fair?
>
> thinking about it more, it's probably better if we do no filtering and return all methods in `InstanceKlass->_methods`. How about something like `getAllMethods`:
> 
> ```   
>  /**
>      * Returns a list containing all methods present within this type. This list can include
>      * methods implicitly created and used by the VM.
>      * The returned List is unmodifiable; calls to any mutator method
>      * will always cause {@code UnsupportedOperationException} to be thrown.
>      *
>      * @param forceLink if {@code true}, forces this type to be {@link #link linked}
>      */
>     List<ResolvedJavaMethod> getAllMethods(boolean forceLink);

Yes, that's a good idea - it's more future proof and lets the caller do the filtering.

`This list can include methods implicitly created and used by the VM that are not present in {@link #getDeclaredMethods}.`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25498#discussion_r2113592457


More information about the graal-dev mailing list