changeset 17229:4cbf3ab4b7d2

added graal-truffle.jar to the classes checked by CheckGraalInvariants
author Doug Simon <doug.simon@oracle.com>
date Fri, 26 Sep 2014 14:43:06 +0200
parents c1d10773331f
children 627b11398fdd
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java
diffstat 1 files changed, 25 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java	Fri Sep 26 09:22:45 2014 +0200
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java	Fri Sep 26 14:43:06 2014 +0200
@@ -75,28 +75,31 @@
 
         bootclasspath.split(File.pathSeparator);
 
-        String graalJar = null;
-        for (String e : bootclasspath.split(File.pathSeparator)) {
-            if (e.endsWith("graal.jar")) {
-                graalJar = e;
-                break;
-            }
-        }
-        Assert.assertNotNull("Could not find graal.jar on boot class path: " + bootclasspath, graalJar);
+        final List<String> classNames = new ArrayList<>();
+        for (String jarName : new String[]{"graal.jar", "graal-truffle.jar"}) {
 
-        final List<String> classNames = new ArrayList<>();
-        try {
-            final ZipFile zipFile = new ZipFile(new File(graalJar));
-            for (final Enumeration<? extends ZipEntry> e = zipFile.entries(); e.hasMoreElements();) {
-                final ZipEntry zipEntry = e.nextElement();
-                String name = zipEntry.getName();
-                if (name.endsWith(".class")) {
-                    String className = name.substring(0, name.length() - ".class".length()).replace('/', '.');
-                    classNames.add(className);
+            String jar = null;
+            for (String e : bootclasspath.split(File.pathSeparator)) {
+                if (e.endsWith(jarName)) {
+                    jar = e;
+                    break;
                 }
             }
-        } catch (IOException e) {
-            Assert.fail(e.toString());
+            Assert.assertNotNull("Could not find graal.jar on boot class path: " + bootclasspath, jar);
+
+            try {
+                final ZipFile zipFile = new ZipFile(new File(jar));
+                for (final Enumeration<? extends ZipEntry> e = zipFile.entries(); e.hasMoreElements();) {
+                    final ZipEntry zipEntry = e.nextElement();
+                    String name = zipEntry.getName();
+                    if (name.endsWith(".class")) {
+                        String className = name.substring(0, name.length() - ".class".length()).replace('/', '.');
+                        classNames.add(className);
+                    }
+                }
+            } catch (IOException e) {
+                Assert.fail(e.toString());
+            }
         }
 
         // Allows a subset of methods to be checked through use of a system property
@@ -131,8 +134,9 @@
                         boolean verifyEquals = !m.isAnnotationPresent(ExcludeFromIdentityComparisonVerification.class);
                         if (matches(filters, methodName)) {
                             executor.execute(() -> {
-                                StructuredGraph graph = new StructuredGraph(metaAccess.lookupJavaMethod(m));
-                                try (DebugConfigScope s = Debug.setConfig(new DelegatingDebugConfig().disable(INTERCEPT))) {
+                                ResolvedJavaMethod method = metaAccess.lookupJavaMethod(m);
+                                StructuredGraph graph = new StructuredGraph(method);
+                                try (DebugConfigScope s = Debug.setConfig(new DelegatingDebugConfig().disable(INTERCEPT)); Debug.Scope ds = Debug.scope("CheckingGraph", graph, method)) {
                                     graphBuilderSuite.apply(graph, context);
                                     // update phi stamps
                                     graph.getNodes().filter(PhiNode.class).forEach(PhiNode::inferStamp);