1294 1295 public boolean cmpSometimesEqual1(Object a) { 1296 return a == a; 1297 } 1298 1299 public boolean cmpSometimesEqual2(Object a) { 1300 return a != a; 1301 } 1302 1303 static int get_full_opt_level() { 1304 int n = (int)TieredStopAtLevel; 1305 if (n >= 4) { 1306 n = 4; 1307 } 1308 return n; 1309 } 1310 protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); 1311 protected static final long TieredStopAtLevel = (Long)WHITE_BOX.getVMFlag("TieredStopAtLevel"); 1312 protected static final int COMP_LEVEL_FULL_OPTIMIZATION = get_full_opt_level(); 1313 1314 // FIXME: temp -- special handling for C1 testing. 1315 protected static final boolean EnableValhallaC1 = (Boolean)WHITE_BOX.getVMFlag("EnableValhallaC1"); 1316 1317 public void runTest(Method m, Object[] args, int warmup, int nullMode, boolean[][] equalities) throws Exception { 1318 Class<?>[] parameterTypes = m.getParameterTypes(); 1319 int parameterCount = parameterTypes.length; 1320 // Nullness mode for first argument 1321 // 0: default, 1: never null, 2: always null 1322 int start = (nullMode != 1) ? 0 : 1; 1323 int end = (nullMode != 2) ? args.length : 1; 1324 for (int i = start; i < end; ++i) { 1325 if (args[i] != null && !parameterTypes[0].isInstance(args[i])) { 1326 continue; 1327 } 1328 if (args[i] == null && parameterTypes[0] == MyValue1.class) { 1329 continue; 1330 } 1331 if (parameterCount == 1) { 1332 // Null checks 1333 System.out.print("Testing " + m.getName() + "(" + args[i] + ")"); 1334 // Avoid acmp in the computation of the expected result! 1335 boolean expected = isNegated(m) ? (i != 0) : (i == 0); 1336 for (int run = 0; run < warmup; ++run) { | 1294 1295 public boolean cmpSometimesEqual1(Object a) { 1296 return a == a; 1297 } 1298 1299 public boolean cmpSometimesEqual2(Object a) { 1300 return a != a; 1301 } 1302 1303 static int get_full_opt_level() { 1304 int n = (int)TieredStopAtLevel; 1305 if (n >= 4) { 1306 n = 4; 1307 } 1308 return n; 1309 } 1310 protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); 1311 protected static final long TieredStopAtLevel = (Long)WHITE_BOX.getVMFlag("TieredStopAtLevel"); 1312 protected static final int COMP_LEVEL_FULL_OPTIMIZATION = get_full_opt_level(); 1313 1314 public void runTest(Method m, Object[] args, int warmup, int nullMode, boolean[][] equalities) throws Exception { 1315 Class<?>[] parameterTypes = m.getParameterTypes(); 1316 int parameterCount = parameterTypes.length; 1317 // Nullness mode for first argument 1318 // 0: default, 1: never null, 2: always null 1319 int start = (nullMode != 1) ? 0 : 1; 1320 int end = (nullMode != 2) ? args.length : 1; 1321 for (int i = start; i < end; ++i) { 1322 if (args[i] != null && !parameterTypes[0].isInstance(args[i])) { 1323 continue; 1324 } 1325 if (args[i] == null && parameterTypes[0] == MyValue1.class) { 1326 continue; 1327 } 1328 if (parameterCount == 1) { 1329 // Null checks 1330 System.out.print("Testing " + m.getName() + "(" + args[i] + ")"); 1331 // Avoid acmp in the computation of the expected result! 1332 boolean expected = isNegated(m) ? (i != 0) : (i == 0); 1333 for (int run = 0; run < warmup; ++run) { |