RFR 8183929: [MVT] Bad intrinsic for guard with test causes wrong behavior

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Jul 6 11:53:43 UTC 2017


This is a fix for the bug discovered by Roland. There's a bad 
conditional jump being generated by the selectAlternative intrinsic - 
the patch I pushed yesterday did a 'ifne fallback' while 
InvokeBytecodeGenerator does a 'ifeq fallback'. This mistake was 
probably caused by a bug in the IBG comment next to the intrinsic ASM line.

I've also added the Point library I'm using for testing these days. 
There's a very basic Point class with fields 'x' and 'y' with a 'norm' 
method. I have tests for:

* creating a factory of Point
* compute the norm of a Point
* compute total norm of an array of Points

For each of these checks, the test has both the bytecode version (with 
MethodHandleBuilder) and the pure MH version (through combinators). The 
test checks that both results conform to what is expected (e.g. some 
operation on the boxed class).

I've added a final test for the guardWithTest example which was indeed 
failing before this fix.

http://cr.openjdk.java.net/~mcimadamore/8183929/


Cheers
Maurizio



More information about the valhalla-dev mailing list