RFR: 8343427: Class file load hook crashes on archived classes from multi-release JARs [v2]
David Holmes
dholmes at openjdk.org
Thu Nov 21 06:23:17 UTC 2024
On Wed, 20 Nov 2024 22:02:34 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Currently, when retrieving a ClassFileStream during runtime, we call into the zip library to retrieve the stream based only on a class name. This doesn't work well if the class is in a multi-release jar under a versioned directory such as `META-INF/versions/9/Foo.class`. To address this issue, this change calls the java api `ClassLoader.getResourceAsStream()` to retrieve the stream.
>>
>> Passed tiers 1 - 4 testing.
>
> Calvin Cheung has updated the pull request incrementally with one additional commit since the last revision:
>
> updated testcase
src/hotspot/share/cds/filemap.cpp line 2705:
> 2703:
> 2704: // InputStream ClassLoader.getResourceAsStream(String name)
> 2705: JavaCalls::call_virtual(&result,
Do we really have to make two Java upcalls to do this? What is the performance hit? Can we declare a helper method in ClassLoader that does it in one? Is there any risk of getting into a recursive loop here?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22262#discussion_r1851422798
More information about the hotspot-dev
mailing list