313 "double CompileThresholdScaling := 0.000000 {product}",
314 "interpreted mode"
315 }
316 };
317
318 private static void verifyValidOption(String[] arguments, String[] expected_outputs, boolean tiered) throws Exception {
319 ProcessBuilder pb;
320 OutputAnalyzer out;
321
322 pb = ProcessTools.createJavaProcessBuilder(arguments);
323 out = new OutputAnalyzer(pb.start());
324
325 try {
326 for (String expected_output : expected_outputs) {
327 out.shouldContain(expected_output);
328 }
329 out.shouldHaveExitValue(0);
330 } catch (RuntimeException e) {
331 // Check if tiered compilation is available in this JVM
332 // Version. Throw exception only if it is available.
333 if (!(tiered && out.getOutput().contains("Client VM warning: TieredCompilation is disabled in this release."))) {
334 throw new RuntimeException(e);
335 }
336 }
337 }
338
339 public static void main(String[] args) throws Exception {
340
341 if (NON_TIERED_ARGUMENTS.length != NON_TIERED_EXPECTED_OUTPUTS.length) {
342 throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in non-tiered mode of operation does not match.");
343 }
344
345 if (TIERED_ARGUMENTS.length != TIERED_EXPECTED_OUTPUTS.length) {
346 throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in tiered mode of operation.");
347 }
348
349 // Check if thresholds are scaled properly in non-tiered mode of operation
350 for (int i = 0; i < NON_TIERED_ARGUMENTS.length; i++) {
351 verifyValidOption(NON_TIERED_ARGUMENTS[i], NON_TIERED_EXPECTED_OUTPUTS[i], false);
352 }
353
|
313 "double CompileThresholdScaling := 0.000000 {product}",
314 "interpreted mode"
315 }
316 };
317
318 private static void verifyValidOption(String[] arguments, String[] expected_outputs, boolean tiered) throws Exception {
319 ProcessBuilder pb;
320 OutputAnalyzer out;
321
322 pb = ProcessTools.createJavaProcessBuilder(arguments);
323 out = new OutputAnalyzer(pb.start());
324
325 try {
326 for (String expected_output : expected_outputs) {
327 out.shouldContain(expected_output);
328 }
329 out.shouldHaveExitValue(0);
330 } catch (RuntimeException e) {
331 // Check if tiered compilation is available in this JVM
332 // Version. Throw exception only if it is available.
333 if (!(tiered && out.getOutput().contains("TieredCompilation is disabled in this release."))) {
334 throw new RuntimeException(e);
335 }
336 }
337 }
338
339 public static void main(String[] args) throws Exception {
340
341 if (NON_TIERED_ARGUMENTS.length != NON_TIERED_EXPECTED_OUTPUTS.length) {
342 throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in non-tiered mode of operation does not match.");
343 }
344
345 if (TIERED_ARGUMENTS.length != TIERED_EXPECTED_OUTPUTS.length) {
346 throw new RuntimeException("Test is set up incorrectly: length of arguments and expected outputs in tiered mode of operation.");
347 }
348
349 // Check if thresholds are scaled properly in non-tiered mode of operation
350 for (int i = 0; i < NON_TIERED_ARGUMENTS.length; i++) {
351 verifyValidOption(NON_TIERED_ARGUMENTS[i], NON_TIERED_EXPECTED_OUTPUTS[i], false);
352 }
353
|