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 17:54:27 GMT, Doug Simon <dnsimon at openjdk.org> wrote:
>> Currently from ResolvedJavaType one can retrieve all declared methods, static methods, and constructors of the given type. However, internally in HotSpot there are also VM-internal methods, such as overpass methods, associated with a given type which we cannot access via the API.
>>
>> To correct this, we should add a new method which enables VM-internal methods, such as overpass methods, to be accessed.
>
> 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?
> src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java line 586:
>
>> 584: return false;
>> 585: }
>> 586: return !compilerToVM().isOverpass(this);
>
> I think you can do this with a direct flag check:
>
> boolean isOverpass = (getConstMethodFlags() & config().constMethodIsOverpass) != 0;
> return isOverpass;
>
> See #20256 as an example of the other changes needed for this.
good call. changed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25498#discussion_r2112886022
PR Review Comment: https://git.openjdk.org/jdk/pull/25498#discussion_r2112884946
More information about the graal-dev
mailing list