9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test NullCheckDroppingsTest 26 * @bug 8054492 27 * @summary Casting can result in redundant null checks in generated code 28 * @requires vm.flavor == "server" 29 * @library /testlibrary /test/lib 30 * @modules java.base/jdk.internal.misc 31 * java.management 32 * 33 * @build ClassFileInstaller sun.hotspot.WhiteBox jdk.test.lib.* 34 * @build compiler.intrinsics.klass.CastNullCheckDroppingsTest 35 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 36 * sun.hotspot.WhiteBox$WhiteBoxPermission 37 * jdk.test.lib.Platform 38 * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI 39 * -Xmixed -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:CompileThreshold=1000 40 * -XX:CompileCommand=exclude,compiler.intrinsics.klass.CastNullCheckDroppingsTest::runTest 41 * compiler.intrinsics.klass.CastNullCheckDroppingsTest 42 */ 43 44 package compiler.intrinsics.klass; 45 46 import jdk.test.lib.Platform; 47 import sun.hotspot.WhiteBox; 48 import sun.hotspot.code.NMethod; 49 50 import java.lang.invoke.MethodHandle; 51 import java.lang.invoke.MethodHandles; 52 import java.lang.invoke.MethodType; 53 import java.lang.reflect.Method; 54 import java.util.function.BiFunction; 55 56 public class CastNullCheckDroppingsTest { 57 | 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test NullCheckDroppingsTest 26 * @bug 8054492 27 * @summary Casting can result in redundant null checks in generated code 28 * @requires vm.flavor == "server" 29 * @library /test/lib 30 * @modules java.base/jdk.internal.misc 31 * java.management 32 * 33 * @build sun.hotspot.WhiteBox 34 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 35 * sun.hotspot.WhiteBox$WhiteBoxPermission 36 * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI 37 * -Xmixed -XX:-BackgroundCompilation -XX:-TieredCompilation -XX:CompileThreshold=1000 38 * -XX:CompileCommand=exclude,compiler.intrinsics.klass.CastNullCheckDroppingsTest::runTest 39 * compiler.intrinsics.klass.CastNullCheckDroppingsTest 40 */ 41 42 package compiler.intrinsics.klass; 43 44 import jdk.test.lib.Platform; 45 import sun.hotspot.WhiteBox; 46 import sun.hotspot.code.NMethod; 47 48 import java.lang.invoke.MethodHandle; 49 import java.lang.invoke.MethodHandles; 50 import java.lang.invoke.MethodType; 51 import java.lang.reflect.Method; 52 import java.util.function.BiFunction; 53 54 public class CastNullCheckDroppingsTest { 55 |