--- old/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java 2017-03-16 14:00:38.623302969 +0100 +++ new/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java 2017-03-16 14:00:35.107304654 +0100 @@ -1419,6 +1419,41 @@ test58(); } + // When calling a method on __Value, passing fields as arguments is impossible + @Test(valid = ValueTypePassFieldsAsArgsOn, match = {ALLOC, STORE}, matchCount={1, 9}) + @Test(valid = ValueTypePassFieldsAsArgsOff, failOn = ALLOC + STORE + LOAD) + public String test59(MyValue1 v) { + return v.toString(); + } + + @DontCompile + public void test59_verifier(boolean warmup) { + boolean failed = false; + try { + test59(val1); + failed = true; + } catch (UnsupportedOperationException uoe) { + } + Asserts.assertFalse(failed); + } + + // Same as above, but the method on __Value is inlined + // hashCode allocates an exception so can't really check the graph shape + @Test() + public int test60(MyValue1 v) { + return v.hashCode(); + } + + @DontCompile + public void test60_verifier(boolean warmup) { + boolean failed = false; + try { + test60(val1); + failed = true; + } catch (UnsupportedOperationException uoe) { + } + Asserts.assertFalse(failed); + } // ========== Test infrastructure ========== @@ -1492,7 +1527,8 @@ "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.ValueTypeTestBench::*", "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.MyValue1::*", "-XX:CompileCommand=compileonly,compiler.valhalla.valuetypes.MyValue2::*", - "-XX:CompileCommand=compileonly,java.lang.Object::"); + "-XX:CompileCommand=compileonly,java.lang.Object::", + "-XX:CompileCommand=inline,java.lang.__Value::hashCode"); } else { // Execute tests ValueTypeTestBench bench = new ValueTypeTestBench();