# HG changeset patch # User Thomas Wuerthinger # Date 1339081281 -7200 # Node ID 8d7d009a54d8b67767e9c34d2acc5a6dab027786 # Parent eb0d4946a1ea285de47e184709c8276424abd9dc Introduction of com.oracle.graal.api project. diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.api/src/com/oracle/graal/api/Graal.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api/src/com/oracle/graal/api/Graal.java Thu Jun 07 17:01:21 2012 +0200 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2012, 2012, 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.api; + + +public class Graal { + + private static GraalRuntime runtime; + private static volatile boolean initialized; + + private static native GraalRuntime initializeRuntime(); + + public static GraalRuntime getRuntime() { + ensureInitialized(); + return runtime; + } + + public static boolean hasRuntime() { + return getRuntime() != null; + } + + private static void ensureInitialized() { + boolean wasInitialized = initialized; + if (!wasInitialized) { + synchronized (Graal.class) { + if (!initialized) { + try { + runtime = initializeRuntime(); + } catch (UnsatisfiedLinkError e) { + runtime = null; + } + initialized = true; + } + } + } + } +} diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.api/src/com/oracle/graal/api/GraalRuntime.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api/src/com/oracle/graal/api/GraalRuntime.java Thu Jun 07 17:01:21 2012 +0200 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2012, 2012, 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.api; + + +public interface GraalRuntime { + String getName(); +} diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Thu Jun 07 17:01:21 2012 +0200 @@ -54,7 +54,7 @@ /** * The runtime that this compiler has been configured for. */ - public final GraalRuntime runtime; + public final ExtendedRiRuntime runtime; /** * The XIR generator that lowers Java operations to machine operations. @@ -66,7 +66,7 @@ */ public final Backend backend; - public GraalCompiler(GraalRuntime runtime, CiTarget target, Backend backend, RiXirGenerator xirGen) { + public GraalCompiler(ExtendedRiRuntime runtime, CiTarget target, Backend backend, RiXirGenerator xirGen) { this.runtime = runtime; this.target = target; this.xir = xirGen; diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/EscapeAnalysisPhase.java Thu Jun 07 17:01:21 2012 +0200 @@ -241,13 +241,13 @@ } private final CiTarget target; - private final GraalRuntime runtime; + private final ExtendedRiRuntime runtime; private final CiAssumptions assumptions; private final RiGraphCache cache; private final PhasePlan plan; private final OptimisticOptimizations optimisticOpts; - public EscapeAnalysisPhase(CiTarget target, GraalRuntime runtime, CiAssumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) { + public EscapeAnalysisPhase(CiTarget target, ExtendedRiRuntime runtime, CiAssumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) { this.runtime = runtime; this.target = target; this.assumptions = assumptions; diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java Thu Jun 07 17:01:21 2012 +0200 @@ -48,7 +48,7 @@ */ private final CiTarget target; - private final GraalRuntime runtime; + private final ExtendedRiRuntime runtime; private final Collection hints; @@ -66,7 +66,7 @@ private static final DebugMetric metricInliningConsidered = Debug.metric("InliningConsidered"); private static final DebugMetric metricInliningStoppedByMaxDesiredSize = Debug.metric("InliningStoppedByMaxDesiredSize"); - public InliningPhase(CiTarget target, GraalRuntime runtime, Collection hints, CiAssumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) { + public InliningPhase(CiTarget target, ExtendedRiRuntime runtime, Collection hints, CiAssumptions assumptions, RiGraphCache cache, PhasePlan plan, OptimisticOptimizations optimisticOpts) { this.target = target; this.runtime = runtime; this.hints = hints; diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java Thu Jun 07 17:01:21 2012 +0200 @@ -31,9 +31,9 @@ public class IntrinsificationPhase extends Phase { - private final GraalRuntime runtime; + private final ExtendedRiRuntime runtime; - public IntrinsificationPhase(GraalRuntime runtime) { + public IntrinsificationPhase(ExtendedRiRuntime runtime) { this.runtime = runtime; } @@ -47,18 +47,18 @@ } } - public static boolean canIntrinsify(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) { + public static boolean canIntrinsify(Invoke invoke, RiResolvedMethod target, ExtendedRiRuntime runtime) { return getIntrinsicGraph(invoke, target, runtime) != null; } - private static void tryIntrinsify(Invoke invoke, GraalRuntime runtime) { + private static void tryIntrinsify(Invoke invoke, ExtendedRiRuntime runtime) { RiResolvedMethod target = invoke.callTarget().targetMethod(); if (target != null) { tryIntrinsify(invoke, target, runtime); } } - private static void tryIntrinsify(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) { + private static void tryIntrinsify(Invoke invoke, RiResolvedMethod target, ExtendedRiRuntime runtime) { StructuredGraph intrinsicGraph = getIntrinsicGraph(invoke, target, runtime); if (intrinsicGraph != null) { Debug.log(" > Intrinsify %s", target); @@ -66,7 +66,7 @@ } } - private static StructuredGraph getIntrinsicGraph(Invoke invoke, RiResolvedMethod target, GraalRuntime runtime) { + private static StructuredGraph getIntrinsicGraph(Invoke invoke, RiResolvedMethod target, ExtendedRiRuntime runtime) { StructuredGraph intrinsicGraph = (StructuredGraph) target.compilerStorage().get(Graph.class); if (intrinsicGraph == null) { // TODO remove once all intrinsics are available via compilerStorage diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java Thu Jun 07 17:01:21 2012 +0200 @@ -41,7 +41,7 @@ private class LoweringToolBase implements CiLoweringTool { @Override - public GraalRuntime getRuntime() { + public ExtendedRiRuntime getRuntime() { return runtime; } @@ -72,10 +72,10 @@ } } - private final GraalRuntime runtime; + private final ExtendedRiRuntime runtime; private final CiAssumptions assumptions; - public LoweringPhase(GraalRuntime runtime, CiAssumptions assumptions) { + public LoweringPhase(ExtendedRiRuntime runtime, CiAssumptions assumptions) { this.runtime = runtime; this.assumptions = assumptions; } diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java Thu Jun 07 17:01:21 2012 +0200 @@ -124,7 +124,7 @@ * @param runtime * @param callback */ - public abstract void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback); + public abstract void inline(StructuredGraph graph, ExtendedRiRuntime runtime, InliningCallback callback); } /** @@ -140,7 +140,7 @@ } @Override - public void inline(StructuredGraph compilerGraph, GraalRuntime runtime, final InliningCallback callback) { + public void inline(StructuredGraph compilerGraph, ExtendedRiRuntime runtime, final InliningCallback callback) { StructuredGraph graph = getGraph(concrete, callback); assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime); callback.recordMethodContentsAssumption(concrete); @@ -183,7 +183,7 @@ } @Override - public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) { + public void inline(StructuredGraph graph, ExtendedRiRuntime runtime, InliningCallback callback) { // receiver null check must be before the type check InliningUtil.receiverNullCheck(invoke); ValueNode receiver = invoke.callTarget().receiver(); @@ -249,7 +249,7 @@ } @Override - public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) { + public void inline(StructuredGraph graph, ExtendedRiRuntime runtime, InliningCallback callback) { int numberOfMethods = concretes.size(); boolean hasReturnValue = invoke.node().kind() != CiKind.Void; @@ -266,7 +266,7 @@ return notRecordedTypeProbability > 0; } - private void inlineMultipleMethods(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback, int numberOfMethods, boolean hasReturnValue) { + private void inlineMultipleMethods(StructuredGraph graph, ExtendedRiRuntime runtime, InliningCallback callback, int numberOfMethods, boolean hasReturnValue) { FixedNode continuation = invoke.next(); // setup merge and phi nodes for results and exceptions @@ -372,7 +372,7 @@ return commonType; } - private void inlineSingleMethod(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) { + private void inlineSingleMethod(StructuredGraph graph, ExtendedRiRuntime runtime, InliningCallback callback) { assert concretes.size() == 1 && ptypes.length > 1 && !shouldFallbackToInvoke() && notRecordedTypeProbability == 0; MergeNode calleeEntryNode = graph.add(new MergeNode()); @@ -522,7 +522,7 @@ } @Override - public void inline(StructuredGraph graph, GraalRuntime runtime, InliningCallback callback) { + public void inline(StructuredGraph graph, ExtendedRiRuntime runtime, InliningCallback callback) { if (Debug.isLogEnabled()) { String targetName = CiUtil.format("%H.%n(%p):%r", invoke.callTarget().targetMethod()); String concreteName = CiUtil.format("%H.%n(%p):%r", concrete); @@ -552,7 +552,7 @@ * @param callback a callback that is used to determine the weight of a specific inlining * @return an instance of InlineInfo, or null if no inlining is possible at the given invoke */ - public static InlineInfo getInlineInfo(Invoke invoke, int level, GraalRuntime runtime, CiAssumptions assumptions, InliningCallback callback, OptimisticOptimizations optimisticOpts) { + public static InlineInfo getInlineInfo(Invoke invoke, int level, ExtendedRiRuntime runtime, CiAssumptions assumptions, InliningCallback callback, OptimisticOptimizations optimisticOpts) { RiResolvedMethod parent = invoke.stateAfter().method(); MethodCallTargetNode callTarget = invoke.callTarget(); RiResolvedMethod targetMethod = callTarget.targetMethod(); diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilerImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilerImpl.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilerImpl.java Thu Jun 07 17:01:21 2012 +0200 @@ -157,9 +157,9 @@ } /** - * Factory method for getting a {@link GraalRuntime} instance. This method is called via reflection. + * Factory method for getting a {@link ExtendedRiRuntime} instance. This method is called via reflection. */ - public static GraalRuntime getGraalRuntime() { + public static ExtendedRiRuntime getGraalRuntime() { return getInstance().getRuntime(); } diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java Thu Jun 07 17:01:21 2012 +0200 @@ -55,7 +55,7 @@ /** * CRI runtime implementation for the HotSpot VM. */ -public class HotSpotRuntime implements GraalRuntime { +public class HotSpotRuntime implements ExtendedRiRuntime { public final HotSpotVMConfig config; final HotSpotRegisterConfig regConfig; private final HotSpotRegisterConfig globalStubRegConfig; diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java Thu Jun 07 17:01:21 2012 +0200 @@ -36,7 +36,7 @@ import com.oracle.graal.nodes.java.*; public class IntrinsifyArrayCopyPhase extends Phase { - private final GraalRuntime runtime; + private final ExtendedRiRuntime runtime; private RiResolvedMethod arrayCopy; private RiResolvedMethod byteArrayCopy; private RiResolvedMethod shortArrayCopy; @@ -47,7 +47,7 @@ private RiResolvedMethod doubleArrayCopy; private RiResolvedMethod objectArrayCopy; - public IntrinsifyArrayCopyPhase(GraalRuntime runtime) { + public IntrinsifyArrayCopyPhase(ExtendedRiRuntime runtime) { this.runtime = runtime; try { byteArrayCopy = getArrayCopySnippet(runtime, byte.class); diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java Thu Jun 07 17:01:21 2012 +0200 @@ -27,7 +27,7 @@ import com.oracle.max.cri.ri.*; public interface CiLoweringTool { - GraalRuntime getRuntime(); + ExtendedRiRuntime getRuntime(); ValueNode getGuardAnchor(); ValueNode createNullCheckGuard(ValueNode object, long leafGraphId); ValueNode createGuard(BooleanNode condition, RiDeoptReason deoptReason, RiDeoptAction action, long leafGraphId); diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/ExtendedRiRuntime.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/ExtendedRiRuntime.java Thu Jun 07 17:01:21 2012 +0200 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2011, 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.cri; + +import java.util.*; + +import com.oracle.graal.graph.*; +import com.oracle.graal.nodes.*; +import com.oracle.max.cri.ci.*; +import com.oracle.max.cri.ri.*; + +/** + * Graal-specific extensions for the runtime interface that must be implemented by the VM. + */ +public interface ExtendedRiRuntime extends RiRuntime { + + void lower(Node n, CiLoweringTool tool); + + StructuredGraph intrinsicGraph(RiResolvedMethod caller, int bci, RiResolvedMethod method, List parameters); + + CiTargetMethod compile(RiResolvedMethod method, StructuredGraph graph); + +} diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/GraalRuntime.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/GraalRuntime.java Thu Jun 07 16:28:21 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2011, 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.cri; - -import java.util.*; - -import com.oracle.graal.graph.*; -import com.oracle.graal.nodes.*; -import com.oracle.max.cri.ci.*; -import com.oracle.max.cri.ri.*; - -/** - * Graal-specific extensions for the runtime interface that must be implemented by the VM. - */ -public interface GraalRuntime extends RiRuntime { - - void lower(Node n, CiLoweringTool tool); - - StructuredGraph intrinsicGraph(RiResolvedMethod caller, int bci, RiResolvedMethod method, List parameters); - - CiTargetMethod compile(RiResolvedMethod method, StructuredGraph graph); - -} diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/GraalIntrinsics.java Thu Jun 07 17:01:21 2012 +0200 @@ -30,7 +30,7 @@ * Definition of the snippets that are VM-independent and can be intrinsified by Graal in any VM. */ public class GraalIntrinsics { - public static void installIntrinsics(GraalRuntime runtime, CiTarget target) { + public static void installIntrinsics(ExtendedRiRuntime runtime, CiTarget target) { if (GraalOptions.Intrinsify) { Snippets.install(runtime, target, new MathSnippetsX86()); Snippets.install(runtime, target, new DoubleSnippets()); diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java Thu Jun 07 17:01:21 2012 +0200 @@ -43,7 +43,7 @@ */ public class Snippets { - public static void install(GraalRuntime runtime, CiTarget target, SnippetsInterface obj) { + public static void install(ExtendedRiRuntime runtime, CiTarget target, SnippetsInterface obj) { Class clazz = obj.getClass(); BoxingMethodPool pool = new BoxingMethodPool(runtime); if (clazz.isAnnotationPresent(ClassSubstitution.class)) { @@ -53,7 +53,7 @@ } } - private static void installSnippets(GraalRuntime runtime, CiTarget target, Class< ? extends SnippetsInterface> clazz, BoxingMethodPool pool) { + private static void installSnippets(ExtendedRiRuntime runtime, CiTarget target, Class< ? extends SnippetsInterface> clazz, BoxingMethodPool pool) { for (Method method : clazz.getDeclaredMethods()) { if (method.getAnnotation(Snippet.class) != null) { Method snippet = method; @@ -69,7 +69,7 @@ } } - private static void installSubstitution(GraalRuntime runtime, CiTarget target, Class< ? extends SnippetsInterface> clazz, + private static void installSubstitution(ExtendedRiRuntime runtime, CiTarget target, Class< ? extends SnippetsInterface> clazz, BoxingMethodPool pool, Class original) throws GraalInternalError { for (Method snippet : clazz.getDeclaredMethods()) { try { @@ -90,7 +90,7 @@ } } - private static StructuredGraph buildSnippetGraph(final RiResolvedMethod snippetRiMethod, final GraalRuntime runtime, final CiTarget target, final BoxingMethodPool pool) { + private static StructuredGraph buildSnippetGraph(final RiResolvedMethod snippetRiMethod, final ExtendedRiRuntime runtime, final CiTarget target, final BoxingMethodPool pool) { final StructuredGraph graph = new StructuredGraph(snippetRiMethod); return Debug.scope("BuildSnippetGraph", new Object[] {snippetRiMethod, graph}, new Callable() { @Override diff -r eb0d4946a1ea -r 8d7d009a54d8 graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java --- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java Thu Jun 07 16:28:21 2012 +0200 +++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java Thu Jun 07 17:01:21 2012 +0200 @@ -60,7 +60,7 @@ public abstract class GraphTest { protected final GraalCompiler graalCompiler; - protected final GraalRuntime runtime; + protected final ExtendedRiRuntime runtime; public GraphTest() { Debug.enable(); @@ -118,7 +118,7 @@ return result.toString(); } - protected GraalRuntime runtime() { + protected ExtendedRiRuntime runtime() { return runtime; } diff -r eb0d4946a1ea -r 8d7d009a54d8 mx/projects --- a/mx/projects Thu Jun 07 16:28:21 2012 +0200 +++ b/mx/projects Thu Jun 07 17:01:21 2012 +0200 @@ -22,6 +22,12 @@ library@DACAPO_SCALA@path=lib/dacapo-scala-0.1.0.jar library@DACAPO_SCALA@urls=http://repo.scalabench.org/snapshots/org/scalabench/benchmarks/scala-benchmark-suite/0.1.0-SNAPSHOT/scala-benchmark-suite-0.1.0-20110908.085753-2.jar +# graal.api +project@com.oracle.graal.api@subDir=graal +project@com.oracle.graal.api@sourceDirs=src +project@com.oracle.graal.api@checkstyle=com.oracle.graal.graph +project@com.oracle.graal.api@javaCompliance=1.7 + # graal.hotspot project@com.oracle.graal.hotspot@subDir=graal project@com.oracle.graal.hotspot@sourceDirs=src