RFR(S) JDK-8206140 [lworld] Move return value null checks into the callee (original) (raw)

Tobias Hartmann tobias.hartmann at oracle.com
Tue Jul 10 12:01:44 UTC 2018


Hi Ioi,

thanks for looking at this!

On 10.07.2018 07:07, Ioi Lam wrote:

http://cr.openjdk.java.net/~iklam/valhalla/8206140lworldnullcheckincallee.v02/

To improve interpreter speed (so we won't excessively trap into the VM whenever a null is returned -- this is especially important for methods that are NOT returning a VT), I added 2 bits in Method::flags. These allow the interpreter to quickly check if the areturn is working on a method that returns a VT.

The flags handling is complicated by the fact that "legacy" classes may return a VT (see [1]). Please see my comments around Method::checkreturningvt. I added a new test case for this -- see TestLWorld::test78). Anyway, I am not happy with this check, so if you can think of a better way, please let me know.

Great that you were able to create a test for this. I don't think we can easily avoid that check but I think it's sufficient if you add the detailed explanation to the test and remove the else branch (or add a short comment) in method.cpp.

Someone more familiar with the interpreter/runtime should look at this as well.

Thanks, Tobias



More information about the valhalla-dev mailing list