RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]
Shaojin Wen
duke at openjdk.org
Mon Jul 22 07:26:32 UTC 2024
On Sat, 20 Jul 2024 06:41:25 GMT, Chen Liang <liach at openjdk.org> wrote:
> > If code is generated through ClassFile, how to access the private methods of classes such as String/StringConcatHelper?
>
> In that case, you have to encode those methods as live `MethodHandle` objects, passed to the generated class with `defineHiddenClassWithClassData` (just pass the class data object) They can be retrieved in generated code with a CONDY using `MethodHandles.classData`. (This is how the MethodHandle LambdaForm classes referred to other MethodHandles)
>
> You don't really need to worry about experimenting with bytecode generation right now. This patch as is is very good, and tier 1-3 tests pass. Bytecode gen is aimed at more complex scenarios with multiple constants and various types of arguments instead of this simple concat case.
@liach Can you give a sample code?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20253#issuecomment-2242267516
More information about the core-libs-dev
mailing list