--- old/src/hotspot/share/classfile/verificationType.cpp 2019-02-06 14:06:47.372955479 -0500 +++ new/src/hotspot/share/classfile/verificationType.cpp 2019-02-06 14:06:46.810549058 -0500 @@ -109,6 +109,7 @@ VerificationType comp_this = get_component(context, CHECK_false); VerificationType comp_from = from.get_component(context, CHECK_false); +/* // This code implements non-covariance between value type arrays and both // arrays of objects and arrays of interface types. If covariance is // supported for value type arrays then this code should be removed. @@ -135,7 +136,7 @@ } } } - +*/ if (!comp_this.is_bogus() && !comp_from.is_bogus()) { return comp_this.is_component_assignable_from(comp_from, context, from_field_is_protected, THREAD); --- old/test/hotspot/jtreg/runtime/valhalla/valuetypes/verifier/NoArrayCov.jcod 2019-02-06 14:06:48.691142012 -0500 +++ new/test/hotspot/jtreg/runtime/valhalla/valuetypes/verifier/NoArrayCov.jcod 2019-02-06 14:06:48.125950824 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ * */ -// Test that a VerifyError exception is thrown when trying to pass a value +// Test that a VerifyError exception is not thrown when trying to pass a value // type array when the formal parameter is an array of java.lang.Object. // // // Java program emulating the jcod contents. @@ -59,7 +59,7 @@ // NoArrayCov pa[] = new NoArrayCov[2]; // pa[0] = a; // pa[1] = b; -// a.objArray(pa); // Should cause VerifyError exception !!! +// a.objArray(pa); // Should not cause VerifyError exception !!! // } // } --- old/test/hotspot/jtreg/runtime/valhalla/valuetypes/verifier/NoArrayCovIntf.jcod 2019-02-06 14:06:50.000096288 -0500 +++ new/test/hotspot/jtreg/runtime/valhalla/valuetypes/verifier/NoArrayCovIntf.jcod 2019-02-06 14:06:49.436074505 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ * */ -// Test that a VerifyError exception is thrown when trying to pass a value +// Test that a VerifyError exception is not thrown when trying to pass a value // type array when the formal parameter is an array of an interface type. // // // Java program emulating the jcod contents. @@ -61,7 +61,7 @@ // NoArrayCovIntf pa[] = new NoArrayCovIntf[2]; // pa[0] = a; // pa[1] = b; -// a.iiArray(pa); // Should throw VerifyError. +// a.iiArray(pa); // Should not throw VerifyError. // } // } --- old/test/hotspot/jtreg/runtime/valhalla/valuetypes/verifier/VerifierValueTypes.java 2019-02-06 14:06:51.302922926 -0500 +++ new/test/hotspot/jtreg/runtime/valhalla/valuetypes/verifier/VerifierValueTypes.java 2019-02-06 14:06:50.740533598 -0500 @@ -55,6 +55,11 @@ } } + public static void runTestNoError(String test_name) throws Exception { + System.out.println("Testing: " + test_name); + Class newClass = Class.forName(test_name); + } + public static void main(String[] args) throws Exception { // Test that a defaultvalue opcode with an out of bounds cp index causes a VerifyError. @@ -98,13 +103,11 @@ // Test VerifyError is thrown if a withfield's class operand is not a value type. runTestVerifyError("withfieldObj", "Bad type on operand stack"); - // Test that an array of value types is not assignable to [Ljava/lang/Object; (Non-covariance). - runTestVerifyError("NoArrayCov", - "Type '[QNoArrayCov;' (current frame, stack[1]) is not assignable to '[Ljava/lang/Object;'"); - - // Test that an array of value types is not assignable to an array of interfaces (Non-covariance). - runTestVerifyError("NoArrayCovIntf", - "Type '[QNoArrayCovIntf;' (current frame, stack[1]) is not assignable to '[LII;'"); + // Test that an array of value types is assignable to [Ljava/lang/Object; (Covariance). + runTestNoError("NoArrayCov"); + + // Test that an array of value types is assignable to an array of interfaces (Covariance). + runTestNoError("NoArrayCovIntf"); // Test that null is not assignable to a value type. runTestVerifyError("NoNullVT",