diff graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java @ 5433:d7b5cc23945e

refactored tests to share support for dump-aware compilation
author Doug Simon <doug.simon@oracle.com>
date Wed, 23 May 2012 14:42:28 +0200
parents 0364a2a874b8
children 425c74c9444d
line wrap: on
line diff
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java	Wed May 23 14:39:56 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java	Wed May 23 14:42:28 2012 +0200
@@ -146,6 +146,17 @@
         }
     }
 
+    private static int compilationId = 0;
+
+    protected RiCompiledMethod compile(final RiResolvedMethod method, final StructuredGraph graph) {
+        return Debug.scope("Compiling", new DebugDumpScope(String.valueOf(compilationId++), true), new Callable<RiCompiledMethod>() {
+            public RiCompiledMethod call() throws Exception {
+                CiTargetMethod targetMethod = runtime.compile(method, graph);
+                return addMethod(method, targetMethod);
+            }
+        });
+    }
+
     protected RiCompiledMethod addMethod(final RiResolvedMethod method, final CiTargetMethod tm) {
         Debug.scope("CodeInstall", new Object[] {graalCompiler, method}, new Callable<RiCompiledMethod>() {
             @Override