|
1 /* |
|
2 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
5 * This code is free software; you can redistribute it and/or modify it |
|
6 * under the terms of the GNU General Public License version 2 only, as |
|
7 * published by the Free Software Foundation. |
|
8 * |
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
|
13 * accompanied this code). |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License version |
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 * |
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 * or visit www.oracle.com if you need additional information or have any |
|
21 * questions. |
|
22 */ |
|
23 package org.graalvm.compiler.hotspot.meta; |
|
24 |
|
25 import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; |
|
26 import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; |
|
27 import org.graalvm.compiler.hotspot.word.HotSpotWordTypes; |
|
28 import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins; |
|
29 import org.graalvm.compiler.nodes.spi.LoweringProvider; |
|
30 import org.graalvm.compiler.nodes.spi.Replacements; |
|
31 import org.graalvm.compiler.phases.tiers.SuitesProvider; |
|
32 import org.graalvm.compiler.phases.util.Providers; |
|
33 |
|
34 import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; |
|
35 import jdk.vm.ci.meta.ConstantReflectionProvider; |
|
36 import jdk.vm.ci.meta.MetaAccessProvider; |
|
37 |
|
38 /** |
|
39 * Extends {@link Providers} to include a number of extra capabilities used by the HotSpot parts of |
|
40 * the compiler. |
|
41 */ |
|
42 public class HotSpotProviders extends Providers { |
|
43 |
|
44 private final SuitesProvider suites; |
|
45 private final HotSpotRegistersProvider registers; |
|
46 private final SnippetReflectionProvider snippetReflection; |
|
47 private final HotSpotWordTypes wordTypes; |
|
48 private final Plugins graphBuilderPlugins; |
|
49 |
|
50 public HotSpotProviders(MetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, ConstantFieldProvider constantField, |
|
51 HotSpotForeignCallsProvider foreignCalls, LoweringProvider lowerer, Replacements replacements, SuitesProvider suites, |
|
52 HotSpotRegistersProvider registers, |
|
53 SnippetReflectionProvider snippetReflection, HotSpotWordTypes wordTypes, Plugins graphBuilderPlugins) { |
|
54 super(metaAccess, codeCache, constantReflection, constantField, foreignCalls, lowerer, replacements, new HotSpotStampProvider()); |
|
55 this.suites = suites; |
|
56 this.registers = registers; |
|
57 this.snippetReflection = snippetReflection; |
|
58 this.wordTypes = wordTypes; |
|
59 this.graphBuilderPlugins = graphBuilderPlugins; |
|
60 } |
|
61 |
|
62 @Override |
|
63 public HotSpotCodeCacheProvider getCodeCache() { |
|
64 return (HotSpotCodeCacheProvider) super.getCodeCache(); |
|
65 } |
|
66 |
|
67 @Override |
|
68 public HotSpotForeignCallsProvider getForeignCalls() { |
|
69 return (HotSpotForeignCallsProvider) super.getForeignCalls(); |
|
70 } |
|
71 |
|
72 public SuitesProvider getSuites() { |
|
73 return suites; |
|
74 } |
|
75 |
|
76 public HotSpotRegistersProvider getRegisters() { |
|
77 return registers; |
|
78 } |
|
79 |
|
80 public SnippetReflectionProvider getSnippetReflection() { |
|
81 return snippetReflection; |
|
82 } |
|
83 |
|
84 public Plugins getGraphBuilderPlugins() { |
|
85 return graphBuilderPlugins; |
|
86 } |
|
87 |
|
88 public HotSpotWordTypes getWordTypes() { |
|
89 return wordTypes; |
|
90 } |
|
91 } |