RFR: 8332457: Examine startup overheads from JDK-8294961 [v3]

Chen Liang liach at openjdk.org
Mon May 27 16:22:02 UTC 2024


On Mon, 27 May 2024 16:08:04 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 822:
>> 
>>> 820:                .iconst_0() // false
>>> 821:                .aload(0)// classLoader
>>> 822:                .invokestatic(CD_Class, "forName", MTD_Class_String_boolean_ClassLoader);
>> 
>> We can probably replace this `forName(name, false, thisClassLoader)` with loading a class constant to reduce load on symbols.
>
> I'm wondering why all the `Class.forName(... <proxyClass>.getClassLoader())` is necessary?
> Simple `ldc <class entry>` seems to work well.

Indeed, I initially added it because a JBS ticket recommended so. ldc instruction has the same behavior as such as forName call.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19410#discussion_r1616241702


More information about the core-libs-dev mailing list