RFR: 8341444: Unnecessary check for JSRs in CDS [v2]

David Holmes dholmes at openjdk.org
Mon Oct 14 22:18:10 UTC 2024


On Fri, 4 Oct 2024 17:33:50 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/oops/instanceKlass.cpp line 2459:
>> 
>>> 2457:   // don't have any methods share the Universe::_the_empty_method_array which is in the RO region.
>>> 2458:   if (_methods != nullptr && _methods->length() > 0 && !can_be_verified_at_dumptime()) {
>>> 2459:     // To handle jsr bytecode, new Method* maybe stored into _methods
>> 
>> Based on the comment we only need to do this if the method does contain a JSR bytecode - now we will do it for all cases where verification can't be done at dumptime. ??
>
> Yes, we will put these in RW space the time.  Using the BytecodeStream to look for JSRs in unverified code is risky, so we avoid doing this optimization.

So shouldn't the comment be updated to indicate that we cannot safely check if the jsr bytecode exists and so all methods that can't be verified are made writeable?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21330#discussion_r1800185967


More information about the hotspot-dev mailing list