[9] RFR (S): 8154172: C1: NPE is thrown instead of linkage error when invoking nonexistent method

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Apr 13 16:01:52 UTC 2016


http://cr.openjdk.java.net/~vlivanov/8154172/webrev.00/
https://bugs.openjdk.java.net/browse/JDK-8154172

C1 unconditionally inserts null check before doing a call, even if it 
throws an error during linkage. It contradicts JVMS which requires that 
linking errors precede run-time errors.

The fix is to detect non-resolvable cases and avoid null checks / 
profiling altogether letting the runtime to throw a linkage error.

Testing: regression test, JPRT, RBT (pit-hs-comp.js + jck).

Some clarifications:

    - klass->is_loaded() && !target->is_loaded() is true when method 
resolution fails;

    - static vs non-static checks aren't needed because 
stream()->get_method already returns unloaded method in such case;

Thanks!

Best regards,
Vladimir Ivanov


More information about the hotspot-compiler-dev mailing list