RFR: 8336856: Efficient hidden class-based string concatenation strategy [v23]
Shaojin Wen
duke at openjdk.org
Mon Aug 12 19:31:41 UTC 2024
On Fri, 2 Aug 2024 04:26:45 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix performance regression caused by args.erase()
>
> Because we load the class in the bootstrap loader so it can access java.lang; means our class cannot see user classes as a result.
@liach
If MethodHandles.Lookup.IMPL_LOOKUP is not used, the following error will be reported
Exception in thread "main" java.lang.BootstrapMethodError: bootstrap method initialization exception
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:191)
at java.base/java.lang.invoke.CallSite.makeSite(CallSite.java:316)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:275)
at java.base/java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:265)
at build.tools.symbolgenerator.CreateSymbols.doWrite(CreateSymbols.java:928)
at build.tools.symbolgenerator.CreateSymbols.writeModule(CreateSymbols.java:859)
at build.tools.symbolgenerator.CreateSymbols.writeModulesForVersions(CreateSymbols.java:823)
at build.tools.symbolgenerator.CreateSymbols.createSymbols(CreateSymbols.java:265)
at build.tools.symbolgenerator.CreateSymbols.main(CreateSymbols.java:4791)
Caused by: java.lang.invoke.StringConcatException: Generator failed
at java.base/java.lang.invoke.StringConcatFactory.makeConcatWithConstants(StringConcatFactory.java:403)
at java.base/java.lang.invoke.BootstrapMethodInvoker.invoke(BootstrapMethodInvoker.java:102)
... 8 more
Caused by: java.lang.invoke.StringConcatException: Exception while spinning the class
at java.base/java.lang.invoke.StringConcatFactory$InlineHiddenClassStrategy.generate(StringConcatFactory.java:1333)
at java.base/java.lang.invoke.StringConcatFactory.makeConcatWithConstants(StringConcatFactory.java:394)
... 9 more
Caused by: java.lang.IllegalAccessException: no such constructor: java.lang.String$$StringConcat/0x0000030000110400.<init>(String[])void/newInvokeSpecial
at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:906)
at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:989)
at java.base/java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:3750)
at java.base/java.lang.invoke.MethodHandles$Lookup.findConstructor(MethodHandles.java:2810)
at java.base/java.lang.invoke.StringConcatFactory$InlineHiddenClassStrategy.generate(StringConcatFactory.java:1327)
... 10 more
Caused by: java.lang.IllegalAccessError: class java.lang.StringConcatHelper tried to access private method 'void java.lang.String$$StringConcat/0x0000030000110400.<init>(java.lang.String[])' (java.lang.StringConcatHelper and java.lang.String$$StringConcat/0x0000030000110400 are in module java.base of loader 'bootstrap')
at java.base/java.lang.invoke.MethodHandleNatives.resolve(Native Method)
at java.base/java.lang.invoke.MemberName$Factory.resolve(MemberName.java:957)
at java.base/java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:986)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20273#issuecomment-2284757113
More information about the core-libs-dev
mailing list