548 }
549 }
550
551 // Compile class initializers
552 int compLevel = getCompLevel(null);
553 WHITE_BOX.enqueueInitializerForCompilation(clazz, compLevel);
554 }
555
556 private void run(Class<?>... classes) throws Exception {
557 if (USE_COMPILER && PRINT_IDEAL && !XCOMP) {
558 System.out.println("PrintIdeal enabled");
559 }
560 System.out.format("rI = %d, rL = %d\n", rI, rL);
561
562 setup(getClass());
563 for (Class<?> clazz : classes) {
564 setup(clazz);
565 }
566
567 // Execute tests
568 TreeMap<Long, String> durations = PRINT_TIMES ? new TreeMap<Long, String>() : null;
569 for (Method test : tests.values()) {
570 if (VERBOSE) {
571 System.out.println("Starting " + test.getName());
572 }
573 long startTime = System.nanoTime();
574 Method verifier = getClass().getMethod(test.getName() + "_verifier", boolean.class);
575 // Warmup using verifier method
576 Warmup anno = test.getAnnotation(Warmup.class);
577 int warmup = anno == null ? WARMUP : anno.value();
578 for (int i = 0; i < warmup; ++i) {
579 verifier.invoke(this, true);
580 }
581 int compLevel = getCompLevel(test.getAnnotation(Test.class));
582 // Trigger compilation
583 WHITE_BOX.enqueueMethodForCompilation(test, compLevel);
584 Asserts.assertTrue(!USE_COMPILER || WHITE_BOX.isMethodCompiled(test, false), test + " not compiled");
585 // Check result
586 verifier.invoke(this, false);
587 if (PRINT_TIMES || VERBOSE) {
588 long endTime = System.nanoTime();
|
548 }
549 }
550
551 // Compile class initializers
552 int compLevel = getCompLevel(null);
553 WHITE_BOX.enqueueInitializerForCompilation(clazz, compLevel);
554 }
555
556 private void run(Class<?>... classes) throws Exception {
557 if (USE_COMPILER && PRINT_IDEAL && !XCOMP) {
558 System.out.println("PrintIdeal enabled");
559 }
560 System.out.format("rI = %d, rL = %d\n", rI, rL);
561
562 setup(getClass());
563 for (Class<?> clazz : classes) {
564 setup(clazz);
565 }
566
567 // Execute tests
568 TreeMap<Long, String> durations = (PRINT_TIMES || VERBOSE) ? new TreeMap<Long, String>() : null;
569 for (Method test : tests.values()) {
570 if (VERBOSE) {
571 System.out.println("Starting " + test.getName());
572 }
573 long startTime = System.nanoTime();
574 Method verifier = getClass().getMethod(test.getName() + "_verifier", boolean.class);
575 // Warmup using verifier method
576 Warmup anno = test.getAnnotation(Warmup.class);
577 int warmup = anno == null ? WARMUP : anno.value();
578 for (int i = 0; i < warmup; ++i) {
579 verifier.invoke(this, true);
580 }
581 int compLevel = getCompLevel(test.getAnnotation(Test.class));
582 // Trigger compilation
583 WHITE_BOX.enqueueMethodForCompilation(test, compLevel);
584 Asserts.assertTrue(!USE_COMPILER || WHITE_BOX.isMethodCompiled(test, false), test + " not compiled");
585 // Check result
586 verifier.invoke(this, false);
587 if (PRINT_TIMES || VERBOSE) {
588 long endTime = System.nanoTime();
|