# HG changeset patch # User Josef Eisl # Date 1398151925 -7200 # Node ID 95219992be88db246c7166ee1852dbe7e5b7563a # Parent 7a0e339e0b567588150674bd6932f89fa75a740d Introduce LIRProviders. diff -r 7a0e339e0b56 -r 95219992be88 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRProviders.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRProviders.java Tue Apr 22 09:32:05 2014 +0200 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2013, 2014, 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.common.spi; + +import com.oracle.graal.api.code.*; +import com.oracle.graal.api.meta.*; + +/** + * A set of providers which are required for LIR and/or code generation. Some may not be present + * (i.e., null). + */ +public interface LIRProviders { + + MetaAccessProvider getMetaAccess(); + + CodeCacheProvider getCodeCache(); + + ForeignCallsProvider getForeignCalls(); + + ConstantReflectionProvider getConstantReflection(); + +} diff -r 7a0e339e0b56 -r 95219992be88 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Apr 22 09:55:24 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Apr 22 09:32:05 2014 +0200 @@ -46,7 +46,6 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.options.*; -import com.oracle.graal.phases.util.*; /** * This class traverses the HIR instructions and generates LIR instructions from them. @@ -62,7 +61,7 @@ // @formatter:on } - private final Providers providers; + private final LIRProviders providers; private final CallingConvention cc; private DebugInfoBuilder debugInfoBuilder; @@ -163,7 +162,7 @@ */ public abstract boolean canStoreConstant(Constant c, boolean isCompressed); - public LIRGenerator(Providers providers, CallingConvention cc, LIRGenerationResult res) { + public LIRGenerator(LIRProviders providers, CallingConvention cc, LIRGenerationResult res) { this.res = res; this.providers = providers; this.cc = cc; @@ -184,7 +183,7 @@ return getCodeCache().getTarget(); } - public Providers getProviders() { + public LIRProviders getProviders() { return providers; } diff -r 7a0e339e0b56 -r 95219992be88 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/Providers.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/Providers.java Tue Apr 22 09:55:24 2014 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/Providers.java Tue Apr 22 09:32:05 2014 +0200 @@ -24,13 +24,14 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; +import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.tiers.*; /** * A set of providers, some of which may not be present (i.e., null). */ -public class Providers { +public class Providers implements LIRProviders { private final MetaAccessProvider metaAccess; private final CodeCacheProvider codeCache;