< prev index next >
test/compiler/rangechecks/TestExplicitRangeChecks.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2015, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2016, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 42,53 ****
import jdk.test.lib.Platform;
import sun.misc.Unsafe;
import compiler.whitebox.CompilerWhiteBoxTest;
public class TestExplicitRangeChecks {
!
! static int[] array = new int[10];
@Retention(RetentionPolicy.RUNTIME)
@interface Args {
int[] compile();
int[] good();
--- 42,55 ----
import jdk.test.lib.Platform;
import sun.misc.Unsafe;
import compiler.whitebox.CompilerWhiteBoxTest;
public class TestExplicitRangeChecks {
! private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
! private static final int TIERED_STOP_AT_LEVEL = WHITE_BOX.getIntxVMFlag("TieredStopAtLevel").intValue();
! private static int[] array = new int[10];
! private static boolean success = true;
@Retention(RetentionPolicy.RUNTIME)
@interface Args {
int[] compile();
int[] good();
*** 364,377 ****
test19_helper1(index);
test19_helper2(index);
return true;
}
- static boolean success = true;
-
- private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
-
final HashMap<String,Method> tests = new HashMap<>();
{
for (Method m : this.getClass().getDeclaredMethods()) {
if (m.getName().matches("test[0-9]+(_[0-9])?")) {
assert(Modifier.isStatic(m.getModifiers())) : m;
--- 366,375 ----
*** 437,447 ****
if (res) {
System.out.println(name + " bad result for bad input " + bad[i]);
success = false;
}
! if (Platform.isServer()) {
if (deoptimize && WHITE_BOX.isMethodCompiled(m)) {
System.out.println(name + " not deoptimized on invalid access");
success = false;
} else if (!deoptimize && !WHITE_BOX.isMethodCompiled(m)) {
System.out.println(name + " deoptimized on invalid access");
--- 435,447 ----
if (res) {
System.out.println(name + " bad result for bad input " + bad[i]);
success = false;
}
! // Only perform these additional checks if C2 is available
! if (Platform.isServer() &&
! TIERED_STOP_AT_LEVEL == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) {
if (deoptimize && WHITE_BOX.isMethodCompiled(m)) {
System.out.println(name + " not deoptimized on invalid access");
success = false;
} else if (!deoptimize && !WHITE_BOX.isMethodCompiled(m)) {
System.out.println(name + " deoptimized on invalid access");
< prev index next >