1 /*
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2018, Red Hat Inc. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
138 }
139 try (InitTimer rt = timer("create stamp provider")) {
140 stampProvider = createStampProvider();
141 }
142 try (InitTimer rt = timer("create GC provider")) {
143 gc = createGCProvider(config);
144 }
145
146 Providers p = new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, null, stampProvider, gc);
147
148 try (InitTimer rt = timer("create SnippetReflection provider")) {
149 snippetReflection = createSnippetReflection(graalRuntime, constantReflection, wordTypes);
150 }
151 try (InitTimer rt = timer("create Bytecode provider")) {
152 bytecodeProvider = createBytecodeProvider(metaAccess, snippetReflection);
153 }
154 try (InitTimer rt = timer("create Replacements provider")) {
155 replacements = createReplacements(target, p, snippetReflection, bytecodeProvider);
156 }
157 try (InitTimer rt = timer("create GraphBuilderPhase plugins")) {
158 plugins = createGraphBuilderPlugins(compilerConfiguration, config, constantReflection, foreignCalls, metaAccess, snippetReflection, replacements, wordTypes, graalRuntime.getOptions());
159 replacements.setGraphBuilderPlugins(plugins);
160 }
161 try (InitTimer rt = timer("create Suites provider")) {
162 suites = createSuites(config, graalRuntime, compilerConfiguration, plugins, replacements);
163 }
164 providers = new HotSpotProviders(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, suites, registers,
165 snippetReflection, wordTypes, plugins, gc);
166 replacements.setProviders(providers);
167 }
168 try (InitTimer rt = timer("instantiate backend")) {
169 return createBackend(config, graalRuntime, providers);
170 }
171 }
172
173 protected Plugins createGraphBuilderPlugins(CompilerConfiguration compilerConfiguration, GraalHotSpotVMConfig config, HotSpotConstantReflectionProvider constantReflection,
174 HotSpotHostForeignCallsProvider foreignCalls, HotSpotMetaAccessProvider metaAccess, HotSpotSnippetReflectionProvider snippetReflection,
175 HotSpotReplacementsImpl replacements, HotSpotWordTypes wordTypes, OptionValues options) {
176 Plugins plugins = HotSpotGraphBuilderPlugins.create(compilerConfiguration, config, wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, replacements, options);
177 AArch64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), false, //
178 /* registerMathPlugins */true);
179 return plugins;
180 }
181
182 protected AArch64HotSpotBackend createBackend(GraalHotSpotVMConfig config, HotSpotGraalRuntimeProvider runtime, HotSpotProviders providers) {
183 return new AArch64HotSpotBackend(config, runtime, providers);
184 }
185
186 protected HotSpotRegistersProvider createRegisters() {
187 return new HotSpotRegisters(AArch64HotSpotRegisterConfig.threadRegister, AArch64HotSpotRegisterConfig.heapBaseRegister, sp);
188 }
189
190 protected HotSpotHostForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess,
191 HotSpotCodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) {
192 return new AArch64HotSpotForeignCallsProvider(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters);
193 }
194
195 protected HotSpotSuitesProvider createSuites(GraalHotSpotVMConfig config, HotSpotGraalRuntimeProvider runtime, CompilerConfiguration compilerConfiguration, Plugins plugins,
196 @SuppressWarnings("unused") Replacements replacements) {
197 AArch64SuitesCreator suitesCreator = new AArch64SuitesCreator(compilerConfiguration, plugins, Arrays.asList(SchedulePhase.class));
|
1 /*
2 * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2018, Red Hat Inc. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
138 }
139 try (InitTimer rt = timer("create stamp provider")) {
140 stampProvider = createStampProvider();
141 }
142 try (InitTimer rt = timer("create GC provider")) {
143 gc = createGCProvider(config);
144 }
145
146 Providers p = new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, null, stampProvider, gc);
147
148 try (InitTimer rt = timer("create SnippetReflection provider")) {
149 snippetReflection = createSnippetReflection(graalRuntime, constantReflection, wordTypes);
150 }
151 try (InitTimer rt = timer("create Bytecode provider")) {
152 bytecodeProvider = createBytecodeProvider(metaAccess, snippetReflection);
153 }
154 try (InitTimer rt = timer("create Replacements provider")) {
155 replacements = createReplacements(target, p, snippetReflection, bytecodeProvider);
156 }
157 try (InitTimer rt = timer("create GraphBuilderPhase plugins")) {
158 plugins = createGraphBuilderPlugins(graalRuntime, compilerConfiguration, config, constantReflection, foreignCalls, metaAccess, snippetReflection, replacements, wordTypes,
159 graalRuntime.getOptions());
160 replacements.setGraphBuilderPlugins(plugins);
161 }
162 try (InitTimer rt = timer("create Suites provider")) {
163 suites = createSuites(config, graalRuntime, compilerConfiguration, plugins, replacements);
164 }
165 providers = new HotSpotProviders(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, suites, registers,
166 snippetReflection, wordTypes, plugins, gc);
167 replacements.setProviders(providers);
168 }
169 try (InitTimer rt = timer("instantiate backend")) {
170 return createBackend(config, graalRuntime, providers);
171 }
172 }
173
174 protected Plugins createGraphBuilderPlugins(HotSpotGraalRuntimeProvider graalRuntime,
175 CompilerConfiguration compilerConfiguration,
176 GraalHotSpotVMConfig config,
177 HotSpotConstantReflectionProvider constantReflection,
178 HotSpotHostForeignCallsProvider foreignCalls,
179 HotSpotMetaAccessProvider metaAccess,
180 HotSpotSnippetReflectionProvider snippetReflection,
181 HotSpotReplacementsImpl replacements,
182 HotSpotWordTypes wordTypes,
183 OptionValues options) {
184 Plugins plugins = HotSpotGraphBuilderPlugins.create(graalRuntime,
185 compilerConfiguration,
186 config,
187 wordTypes,
188 metaAccess,
189 constantReflection,
190 snippetReflection,
191 foreignCalls,
192 replacements,
193 options);
194 AArch64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), false,
195 /* registerMathPlugins */true);
196 return plugins;
197 }
198
199 protected AArch64HotSpotBackend createBackend(GraalHotSpotVMConfig config, HotSpotGraalRuntimeProvider runtime, HotSpotProviders providers) {
200 return new AArch64HotSpotBackend(config, runtime, providers);
201 }
202
203 protected HotSpotRegistersProvider createRegisters() {
204 return new HotSpotRegisters(AArch64HotSpotRegisterConfig.threadRegister, AArch64HotSpotRegisterConfig.heapBaseRegister, sp);
205 }
206
207 protected HotSpotHostForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess,
208 HotSpotCodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) {
209 return new AArch64HotSpotForeignCallsProvider(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters);
210 }
211
212 protected HotSpotSuitesProvider createSuites(GraalHotSpotVMConfig config, HotSpotGraalRuntimeProvider runtime, CompilerConfiguration compilerConfiguration, Plugins plugins,
213 @SuppressWarnings("unused") Replacements replacements) {
214 AArch64SuitesCreator suitesCreator = new AArch64SuitesCreator(compilerConfiguration, plugins, Arrays.asList(SchedulePhase.class));
|