Mercurial > hg > truffle
changeset 15257:95219992be88
Introduce LIRProviders.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 22 Apr 2014 09:32:05 +0200 |
parents | 7a0e339e0b56 |
children | c846fbf318f3 |
files | graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRProviders.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/Providers.java |
diffstat | 3 files changed, 47 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- /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(); + +}
--- 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; }
--- 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;