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

Tom Shull duke at openjdk.org
Fri May 30 15:06:09 UTC 2025


On Wed, 28 May 2025 22:46:46 GMT, Tom Shull <duke at openjdk.org> wrote:

>> src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java line 1171:
>> 
>>> 1169: 
>>> 1170:     /**
>>> 1171:      * Gets the {@link ResolvedJavaMethod}s for all instance methods of {@code klass}.
>> 
>> instance -> non-static
>> Instance -> NonStatic
>
> 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);

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

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


More information about the graal-dev mailing list