[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


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;


Best regards,
Vladimir Ivanov

More information about the hotspot-compiler-dev mailing list