RFR: 8341444: Unnecessary check for JSRs in CDS

David Holmes dholmes at openjdk.org
Fri Oct 4 06:00:36 UTC 2024


On Thu, 3 Oct 2024 17:45:42 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

> 8341444: Unnecessary check for JSRs in CDS

Again apologies for commenting and running off on vacation, but this one does not look right to me based on the description.

src/hotspot/share/interpreter/bytecodeStream.hpp line 198:

> 196:       if (len == 0) len = Bytecodes::length_at(_method(), bcp);
> 197:       if (len <= 0 || (_bci > _end_bci - len) || (_bci - len >= _next_bci)) {
> 198:         fatal("Should have been caught by verifier");

Verification may be disabled, This may be a risky change in behaviour.

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. ??

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

PR Review: https://git.openjdk.org/jdk/pull/21330#pullrequestreview-2347186887
PR Review Comment: https://git.openjdk.org/jdk/pull/21330#discussion_r1787187496
PR Review Comment: https://git.openjdk.org/jdk/pull/21330#discussion_r1787188984


More information about the hotspot-dev mailing list