changeset 5780:64257cbef60c

removed compile method from GraalCodeCacheProvider interface added hook for Graal tests to modify the phase plan used during compilation renamed of variables to reflect types: compiler -> graalRuntime, targetMethod -> compResult rename: InvokeTest -> InvokeHintsTest
author Doug Simon <doug.simon@oracle.com>
date Fri, 06 Jul 2012 14:52:42 +0200
parents 1458f656b060
children 039b73517e49
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraalCompilerTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InvokeHintsTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InvokeTest.java
diffstat 9 files changed, 141 insertions(+), 139 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java	Fri Jul 06 09:48:14 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java	Fri Jul 06 14:52:42 2012 +0200
@@ -77,14 +77,15 @@
     long getMaxCallTargetOffset(RuntimeCall rtcall);
 
     /**
-     * Adds the given machine code as an implementation of the given method without making it the default implementation.
+     * Adds the given compilation result as an implementation of the given method without making it the default implementation.
+     *
      * @param method a method to which the executable code is begin added
-     * @param code the code to be added
+     * @param compResult the compilation result to be added
      * @param info the object into which details of the installed code will be written.
      *        Ignored if null, otherwise the info is written to index 0 of this array.
      * @return a reference to the compiled and ready-to-run code
      */
-    InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult code, CodeInfo[] info);
+    InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, CodeInfo[] info);
 
     /**
      * Encodes a deoptimization action and a deoptimization reason in an integer value.
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Fri Jul 06 09:48:14 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Fri Jul 06 14:52:42 2012 +0200
@@ -47,19 +47,19 @@
 
     private volatile boolean cancelled;
 
-    private final HotSpotGraalRuntime compiler;
+    private final HotSpotGraalRuntime graalRuntime;
     private final PhasePlan plan;
     private final HotSpotResolvedJavaMethod method;
     private final OptimisticOptimizations optimisticOpts;
     private final int id;
     private final int priority;
 
-    public static CompilationTask create(HotSpotGraalRuntime compiler, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int id, int priority) {
-        return new CompilationTask(compiler, plan, optimisticOpts, method, id, priority);
+    public static CompilationTask create(HotSpotGraalRuntime graalRuntime, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int id, int priority) {
+        return new CompilationTask(graalRuntime, plan, optimisticOpts, method, id, priority);
     }
 
-    private CompilationTask(HotSpotGraalRuntime compiler, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int id, int priority) {
-        this.compiler = compiler;
+    private CompilationTask(HotSpotGraalRuntime graalRuntime, PhasePlan plan, OptimisticOptimizations optimisticOpts, HotSpotResolvedJavaMethod method, int id, int priority) {
+        this.graalRuntime = graalRuntime;
         this.plan = plan;
         this.method = method;
         this.optimisticOpts = optimisticOpts;
@@ -115,9 +115,9 @@
 
                     @Override
                     public CompilationResult call() throws Exception {
-                        compiler.evictDeoptedGraphs();
+                        graalRuntime.evictDeoptedGraphs();
                         StructuredGraph graph = new StructuredGraph(method);
-                        return compiler.getCompiler().compileMethod(method, graph, -1, compiler.getCache(), plan, optimisticOpts);
+                        return graalRuntime.getCompiler().compileMethod(method, graph, -1, graalRuntime.getCache(), plan, optimisticOpts);
                     }
                 });
             } finally {
@@ -148,11 +148,11 @@
     }
 
     private void installMethod(final CompilationResult tm) {
-        Debug.scope("CodeInstall", new Object[] {new DebugDumpScope(String.valueOf(id), true), compiler.getCompiler(), method}, new Runnable() {
+        Debug.scope("CodeInstall", new Object[] {new DebugDumpScope(String.valueOf(id), true), graalRuntime.getCompiler(), method}, new Runnable() {
             @Override
             public void run() {
                 final CodeInfo[] info = Debug.isDumpEnabled() ? new CodeInfo[1] : null;
-                compiler.getRuntime().installMethod(method, tm, info);
+                graalRuntime.getRuntime().installMethod(method, tm, info);
                 if (info != null) {
                     Debug.dump(new Object[] {tm, info[0]}, "After code installation");
                 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Fri Jul 06 09:48:14 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Fri Jul 06 14:52:42 2012 +0200
@@ -63,7 +63,7 @@
 
     void ConstantPool_loadReferencedType(HotSpotResolvedJavaType pool, int cpi, byte byteCode);
 
-    HotSpotCompiledMethod installMethod(HotSpotCompilationResult comp, boolean makeDefault, HotSpotCodeInfo info);
+    HotSpotCompiledMethod installMethod(HotSpotCompilationResult compResult, boolean makeDefault, HotSpotCodeInfo info);
 
     HotSpotVMConfig getConfiguration();
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Jul 06 09:48:14 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Jul 06 14:52:42 2012 +0200
@@ -113,7 +113,7 @@
                 @Override
                 public void run() {
                     VMToCompilerImpl.this.intrinsifyArrayCopy = new IntrinsifyArrayCopyPhase(runtime);
-                    SnippetInstaller installer = new SnippetInstaller(runtime, runtime.getCompiler().getTarget());
+                    SnippetInstaller installer = new SnippetInstaller(runtime, runtime.getGraalRuntime().getTarget());
                     GraalIntrinsics.installIntrinsics(installer);
                     runtime.installSnippets(installer);
                 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Fri Jul 06 09:48:14 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Fri Jul 06 14:52:42 2012 +0200
@@ -58,13 +58,13 @@
     public final HotSpotVMConfig config;
     final HotSpotRegisterConfig regConfig;
     private final HotSpotRegisterConfig globalStubRegConfig;
-    private final HotSpotGraalRuntime compiler;
+    private final HotSpotGraalRuntime graalRuntime;
     private CheckCastSnippets.Templates checkcastSnippets;
     private NewObjectSnippets.Templates newObjectSnippets;
 
-    public HotSpotRuntime(HotSpotVMConfig config, HotSpotGraalRuntime compiler) {
+    public HotSpotRuntime(HotSpotVMConfig config, HotSpotGraalRuntime graalRuntime) {
         this.config = config;
-        this.compiler = compiler;
+        this.graalRuntime = graalRuntime;
         regConfig = new HotSpotRegisterConfig(config, false);
         globalStubRegConfig = new HotSpotRegisterConfig(config, true);
 
@@ -78,18 +78,18 @@
         installer.install(CheckCastSnippets.class);
         installer.install(NewObjectSnippets.class);
         checkcastSnippets = new CheckCastSnippets.Templates(this);
-        newObjectSnippets = new NewObjectSnippets.Templates(this, compiler.getTarget(), config.useTLAB);
+        newObjectSnippets = new NewObjectSnippets.Templates(this, graalRuntime.getTarget(), config.useTLAB);
     }
 
 
-    public HotSpotGraalRuntime getCompiler() {
-        return compiler;
+    public HotSpotGraalRuntime getGraalRuntime() {
+        return graalRuntime;
     }
 
     @Override
     public String disassemble(CodeInfo info, CompilationResult tm) {
         byte[] code = info.code();
-        TargetDescription target = compiler.getTarget();
+        TargetDescription target = graalRuntime.getTarget();
         HexCodeFile hcf = new HexCodeFile(code, info.start(), target.arch.name, target.wordSize * 8);
         if (tm != null) {
             HexCodeFile.addAnnotations(hcf, tm.annotations());
@@ -181,12 +181,12 @@
 
     @Override
     public ResolvedJavaType getResolvedJavaType(Kind kind) {
-        return (ResolvedJavaType) compiler.getCompilerToVM().getType(kind.toJavaClass());
+        return (ResolvedJavaType) graalRuntime.getCompilerToVM().getType(kind.toJavaClass());
     }
 
     @Override
     public ResolvedJavaType getTypeOf(Constant constant) {
-        return (ResolvedJavaType) compiler.getCompilerToVM().getJavaType(constant);
+        return (ResolvedJavaType) graalRuntime.getCompilerToVM().getJavaType(constant);
     }
 
     @Override
@@ -197,7 +197,7 @@
 
     @Override
     public boolean areConstantObjectsEqual(Constant x, Constant y) {
-        return compiler.getCompilerToVM().compareConstantObjects(x, y);
+        return graalRuntime.getCompilerToVM().compareConstantObjects(x, y);
     }
 
     @Override
@@ -221,7 +221,7 @@
 
     @Override
     public int getArrayLength(Constant array) {
-        return compiler.getCompilerToVM().getArrayLength(array);
+        return graalRuntime.getCompilerToVM().getArrayLength(array);
     }
 
     @Override
@@ -474,7 +474,7 @@
     }
 
     public ResolvedJavaType getResolvedJavaType(Class<?> clazz) {
-        return (ResolvedJavaType) compiler.getCompilerToVM().getType(clazz);
+        return (ResolvedJavaType) graalRuntime.getCompilerToVM().getType(clazz);
     }
 
     public Object asCallTarget(Object target) {
@@ -482,31 +482,31 @@
     }
 
     public long getMaxCallTargetOffset(RuntimeCall rtcall) {
-        return compiler.getCompilerToVM().getMaxCallTargetOffset(rtcall);
+        return graalRuntime.getCompilerToVM().getMaxCallTargetOffset(rtcall);
     }
 
     public ResolvedJavaMethod getResolvedJavaMethod(Method reflectionMethod) {
-        return (ResolvedJavaMethod) compiler.getCompilerToVM().getJavaMethod(reflectionMethod);
+        return (ResolvedJavaMethod) graalRuntime.getCompilerToVM().getJavaMethod(reflectionMethod);
     }
 
-    private static HotSpotCodeInfo makeInfo(ResolvedJavaMethod method, CompilationResult code, CodeInfo[] info) {
+    private static HotSpotCodeInfo makeInfo(ResolvedJavaMethod method, CompilationResult compResult, CodeInfo[] info) {
         HotSpotCodeInfo hsInfo = null;
         if (info != null && info.length > 0) {
-            hsInfo = new HotSpotCodeInfo(code, (HotSpotResolvedJavaMethod) method);
+            hsInfo = new HotSpotCodeInfo(compResult, (HotSpotResolvedJavaMethod) method);
             info[0] = hsInfo;
         }
         return hsInfo;
     }
 
-    public void installMethod(ResolvedJavaMethod method, CompilationResult code, CodeInfo[] info) {
-        HotSpotCodeInfo hsInfo = makeInfo(method, code, info);
-        compiler.getCompilerToVM().installMethod(new HotSpotCompilationResult((HotSpotResolvedJavaMethod) method, code), true, hsInfo);
+    public void installMethod(ResolvedJavaMethod method, CompilationResult compResult, CodeInfo[] info) {
+        HotSpotCodeInfo hsInfo = makeInfo(method, compResult, info);
+        graalRuntime.getCompilerToVM().installMethod(new HotSpotCompilationResult((HotSpotResolvedJavaMethod) method, compResult), true, hsInfo);
     }
 
     @Override
-    public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult code, CodeInfo[] info) {
-        HotSpotCodeInfo hsInfo = makeInfo(method, code, info);
-        return compiler.getCompilerToVM().installMethod(new HotSpotCompilationResult((HotSpotResolvedJavaMethod) method, code), false, hsInfo);
+    public InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, CodeInfo[] info) {
+        HotSpotCodeInfo hsInfo = makeInfo(method, compResult, info);
+        return graalRuntime.getCompilerToVM().installMethod(new HotSpotCompilationResult((HotSpotResolvedJavaMethod) method, compResult), false, hsInfo);
     }
 
     @Override
@@ -515,12 +515,6 @@
     }
 
     @Override
-    public CompilationResult compile(ResolvedJavaMethod method, StructuredGraph graph) {
-        OptimisticOptimizations optimisticOpts = OptimisticOptimizations.ALL;
-        return compiler.getCompiler().compileMethod(method, graph, -1, compiler.getCache(), compiler.getVMToCompiler().createPhasePlan(optimisticOpts), optimisticOpts);
-    }
-
-    @Override
     public int encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason) {
         final int actionShift = 0;
         final int reasonShift = 3;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java	Fri Jul 06 09:48:14 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/GraalCodeCacheProvider.java	Fri Jul 06 14:52:42 2012 +0200
@@ -37,7 +37,4 @@
     void lower(Node n, LoweringTool tool);
 
     StructuredGraph intrinsicGraph(ResolvedJavaMethod caller, int bci, ResolvedJavaMethod method, List<? extends Node> parameters);
-
-    CompilationResult compile(ResolvedJavaMethod method, StructuredGraph graph);
-
 }
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraalCompilerTest.java	Fri Jul 06 09:48:14 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraalCompilerTest.java	Fri Jul 06 14:52:42 2012 +0200
@@ -53,7 +53,7 @@
  * <li>Assert that the transformed graph is equal to an expected graph.</li>
  * </ol>
  * <p>
- * See {@link InvokeTest} as an example.
+ * See {@link InvokeHintsTest} as an example.
  * <p>
  * The tests can be run in Eclipse with the "Compiler Unit Test" Eclipse
  * launch configuration found in the top level of this project or by
@@ -62,10 +62,12 @@
 public abstract class GraalCompilerTest {
 
     protected final GraalCodeCacheProvider runtime;
+    protected final GraalCompiler graalCompiler;
 
     public GraalCompilerTest() {
         Debug.enable();
         this.runtime = Graal.getRuntime().getCapability(GraalCodeCacheProvider.class);
+        this.graalCompiler = Graal.getRuntime().getCapability(GraalCompiler.class);
     }
 
     protected void assertEquals(StructuredGraph expected, StructuredGraph graph) {
@@ -198,6 +200,16 @@
     }
 
     /**
+     * Can be overridden to modify the compilation phases applied for a test.
+     *
+     * @param method the method being compiled
+     * @param graph the graph being compiled
+     * @param phasePlan the phase plan to be edited
+     */
+    protected void editPhasePlan(ResolvedJavaMethod method, StructuredGraph graph, PhasePlan phasePlan) {
+    }
+
+    /**
      * Gets installed code for a given method and graph, compiling it first if necessary.
      *
      * @param forceCompile specifies whether to ignore any previous code cached for the (method, key) pair
@@ -211,24 +223,27 @@
         }
         InstalledCode installedCode = Debug.scope("Compiling", new DebugDumpScope(String.valueOf(compilationId++), true), new Callable<InstalledCode>() {
             public InstalledCode call() throws Exception {
-                CompilationResult targetMethod = runtime.compile(method, graph);
-                return addMethod(method, targetMethod);
+                PhasePlan phasePlan = new PhasePlan();
+                GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL);
+                phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
+                editPhasePlan(method, graph, phasePlan);
+                CompilationResult compResult = graalCompiler.compileMethod(method, graph, -1, null, phasePlan, OptimisticOptimizations.ALL);
+                return addMethod(method, compResult);
             }
         });
         cache.put(method, installedCode);
         return installedCode;
     }
 
-    protected InstalledCode addMethod(final ResolvedJavaMethod method, final CompilationResult tm) {
-        GraalCompiler graalCompiler = Graal.getRuntime().getCapability(GraalCompiler.class);
+    protected InstalledCode addMethod(final ResolvedJavaMethod method, final CompilationResult compResult) {
         assert graalCompiler != null;
         return Debug.scope("CodeInstall", new Object[] {graalCompiler, method}, new Callable<InstalledCode>() {
             @Override
             public InstalledCode call() throws Exception {
                 final CodeInfo[] info = Debug.isDumpEnabled() ? new CodeInfo[1] : null;
-                InstalledCode installedMethod = runtime.addMethod(method, tm, info);
+                InstalledCode installedMethod = runtime.addMethod(method, compResult, info);
                 if (info != null) {
-                    Debug.dump(new Object[] {tm, info[0]}, "After code installation");
+                    Debug.dump(new Object[] {compResult, info[0]}, "After code installation");
                 }
                 return installedMethod;
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InvokeHintsTest.java	Fri Jul 06 14:52:42 2012 +0200
@@ -0,0 +1,82 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.compiler.tests;
+
+import java.util.*;
+
+import org.junit.*;
+
+import com.oracle.graal.compiler.*;
+import com.oracle.graal.compiler.phases.*;
+import com.oracle.graal.nodes.*;
+
+public class InvokeHintsTest extends GraalCompilerTest {
+
+    private static final String REFERENCE_SNIPPET = "referenceSnippet";
+
+    public static int const1() {
+        return 1;
+    }
+
+    public static int const7() {
+        return 7;
+    }
+
+    @SuppressWarnings("all")
+    public static int referenceSnippet() {
+        return 7;
+    }
+
+    @Test
+    public void test1() {
+        test("test1Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static int test1Snippet() {
+        return const7();
+    }
+
+    @Test
+    public void test2() {
+        test("test2Snippet");
+    }
+
+    @SuppressWarnings("all")
+    public static int test2Snippet() {
+        return const1() + const1() + const1() + const1() + const1() + const1() + const1();
+    }
+
+    private void test(String snippet) {
+        StructuredGraph graph = parse(snippet);
+        Collection<Invoke> hints = new ArrayList<>();
+        for (Invoke invoke : graph.getInvokes()) {
+            hints.add(invoke);
+        }
+        new InliningPhase(null, runtime(), hints, null, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph);
+        new CanonicalizerPhase(null, runtime(), null).apply(graph);
+        new DeadCodeEliminationPhase().apply(graph);
+        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
+        assertEquals(referenceGraph, graph);
+    }
+}
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InvokeTest.java	Fri Jul 06 09:48:14 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.compiler.tests;
-
-import java.util.*;
-
-import org.junit.*;
-
-import com.oracle.graal.compiler.*;
-import com.oracle.graal.compiler.phases.*;
-import com.oracle.graal.nodes.*;
-
-/**
- * In the following tests, the usages of local variable "a" are replaced with the integer constant 0.
- * Then canonicalization is applied and it is verified that the resulting graph is equal to the
- * graph of the method that just has a "return 1" statement in it.
- */
-public class InvokeTest extends GraalCompilerTest {
-
-    private static final String REFERENCE_SNIPPET = "referenceSnippet";
-
-    public static int const1() {
-        return 1;
-    }
-
-    public static int const7() {
-        return 7;
-    }
-
-    @SuppressWarnings("all")
-    public static int referenceSnippet() {
-        return 7;
-    }
-
-    @Test
-    public void test1() {
-        test("test1Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static int test1Snippet() {
-        return const7();
-    }
-
-    @Test
-    public void test2() {
-        test("test2Snippet");
-    }
-
-    @SuppressWarnings("all")
-    public static int test2Snippet() {
-        return const1() + const1() + const1() + const1() + const1() + const1() + const1();
-    }
-
-    private void test(String snippet) {
-        StructuredGraph graph = parse(snippet);
-        Collection<Invoke> hints = new ArrayList<>();
-        for (Invoke invoke : graph.getInvokes()) {
-            hints.add(invoke);
-        }
-        new InliningPhase(null, runtime(), hints, null, null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph);
-        new CanonicalizerPhase(null, runtime(), null).apply(graph);
-        new DeadCodeEliminationPhase().apply(graph);
-        StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET);
-        assertEquals(referenceGraph, graph);
-    }
-}