RFR: 8339849: Enumerate opto and C1 stubs, generate enums, names, fields and generator calls
Vladimir Kozlov
kvn at openjdk.org
Thu Sep 12 00:30:09 UTC 2024
On Wed, 11 Sep 2024 08:38:19 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
>> Systematize handling of Opto and C1 stubs. Generate enum ids, static fields, stub/blob names and generator code from declarations using template macros as previously done with Shared stubs. Systematically reference stubs and stub names using ids.
>
> src/hotspot/share/opto/runtime.cpp line 151:
>
>> 149: // defines temporarily rebind the generated names to reference the
>> 150: // relevant implementations.
>> 151:
>
> I am not 100% happy about using defines to finesse this problem of common C targets.
>
> One alternative here is to define methods local to class OptoRuntime which fit the generator naming convention and have them forward the call to the SharedRuntime methods. n.b. I used (local) method forwarding to allow blobs to share common typefunc providers.
>
> Another alternative is to declare the C target as a parameter to the opto blob declaration macro. That's more flexible but in almost all cases it repeats information already present and makes understanding and updating the declarations more complex.
This is indeed confusing even with comment.
I prefer your first suggestion: "define methods local to class OptoRuntime which fit the generator naming convention and have them forward the call to the SharedRuntime methods"
> src/hotspot/share/opto/runtime.cpp line 183:
>
>> 181: OPTO_STUBS_DO(GEN_OPTO_BLOB, GEN_OPTO_STUB, GEN_OPTO_JVMTI_STUB)
>> 182:
>> 183: /*
>
> This old code that has been commented out needs to be removed.
Then do it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20936#discussion_r1755904699
PR Review Comment: https://git.openjdk.org/jdk/pull/20936#discussion_r1755900111
More information about the hotspot-dev
mailing list