85 |
85 |
86 @Override |
86 @Override |
87 public HotSpotBackend createBackend(HotSpotGraalRuntimeProvider runtime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntime jvmciRuntime, HotSpotBackend host) { |
87 public HotSpotBackend createBackend(HotSpotGraalRuntimeProvider runtime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntime jvmciRuntime, HotSpotBackend host) { |
88 assert host == null; |
88 assert host == null; |
89 |
89 |
|
90 OptionValues options = runtime.getOptions(); |
90 GraalHotSpotVMConfig config = runtime.getVMConfig(); |
91 GraalHotSpotVMConfig config = runtime.getVMConfig(); |
91 JVMCIBackend jvmci = jvmciRuntime.getHostJVMCIBackend(); |
92 JVMCIBackend jvmci = jvmciRuntime.getHostJVMCIBackend(); |
92 HotSpotRegistersProvider registers = createRegisters(); |
93 HotSpotRegistersProvider registers = createRegisters(); |
93 HotSpotMetaAccessProvider metaAccess = (HotSpotMetaAccessProvider) jvmci.getMetaAccess(); |
94 HotSpotMetaAccessProvider metaAccess = (HotSpotMetaAccessProvider) jvmci.getMetaAccess(); |
94 HotSpotCodeCacheProvider codeCache = (HotSpotCodeCacheProvider) jvmci.getCodeCache(); |
95 HotSpotCodeCacheProvider codeCache = (HotSpotCodeCacheProvider) jvmci.getCodeCache(); |
104 Providers p = new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, null, stampProvider, gc); |
105 Providers p = new Providers(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, null, stampProvider, gc); |
105 HotSpotSnippetReflectionProvider snippetReflection = createSnippetReflection(runtime, constantReflection, wordTypes); |
106 HotSpotSnippetReflectionProvider snippetReflection = createSnippetReflection(runtime, constantReflection, wordTypes); |
106 BytecodeProvider bytecodeProvider = createBytecodeProvider(metaAccess, snippetReflection); |
107 BytecodeProvider bytecodeProvider = createBytecodeProvider(metaAccess, snippetReflection); |
107 HotSpotReplacementsImpl replacements = createReplacements(target, p, snippetReflection, bytecodeProvider); |
108 HotSpotReplacementsImpl replacements = createReplacements(target, p, snippetReflection, bytecodeProvider); |
108 Plugins plugins = createGraphBuilderPlugins(runtime, compilerConfiguration, config, metaAccess, constantReflection, foreignCalls, snippetReflection, replacements, wordTypes, |
109 Plugins plugins = createGraphBuilderPlugins(runtime, compilerConfiguration, config, metaAccess, constantReflection, foreignCalls, snippetReflection, replacements, wordTypes, |
109 runtime.getOptions()); |
110 runtime.getOptions(), target); |
110 replacements.setGraphBuilderPlugins(plugins); |
111 replacements.setGraphBuilderPlugins(plugins); |
111 HotSpotSuitesProvider suites = createSuites(config, runtime, compilerConfiguration, plugins, replacements); |
112 HotSpotSuitesProvider suites = createSuites(config, runtime, compilerConfiguration, plugins, replacements); |
112 HotSpotProviders providers = new HotSpotProviders(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, suites, registers, |
113 HotSpotProviders providers = new HotSpotProviders(metaAccess, codeCache, constantReflection, constantFieldProvider, foreignCalls, lowerer, replacements, suites, registers, |
113 snippetReflection, wordTypes, plugins, gc); |
114 snippetReflection, wordTypes, plugins, gc); |
114 replacements.setProviders(providers); |
115 replacements.setProviders(providers); |
|
116 replacements.maybeInitializeEncoder(options); |
115 |
117 |
116 return createBackend(config, runtime, providers); |
118 return createBackend(config, runtime, providers); |
117 } |
119 } |
118 |
120 |
119 protected Plugins createGraphBuilderPlugins(HotSpotGraalRuntimeProvider graalRuntime, |
121 protected Plugins createGraphBuilderPlugins(HotSpotGraalRuntimeProvider graalRuntime, |
123 HotSpotConstantReflectionProvider constantReflection, |
125 HotSpotConstantReflectionProvider constantReflection, |
124 HotSpotForeignCallsProvider foreignCalls, |
126 HotSpotForeignCallsProvider foreignCalls, |
125 HotSpotSnippetReflectionProvider snippetReflection, |
127 HotSpotSnippetReflectionProvider snippetReflection, |
126 HotSpotReplacementsImpl replacements, |
128 HotSpotReplacementsImpl replacements, |
127 HotSpotWordTypes wordTypes, |
129 HotSpotWordTypes wordTypes, |
128 OptionValues options) { |
130 OptionValues options, |
|
131 TargetDescription target) { |
129 Plugins plugins = HotSpotGraphBuilderPlugins.create( |
132 Plugins plugins = HotSpotGraphBuilderPlugins.create( |
130 graalRuntime, |
133 graalRuntime, |
131 compilerConfiguration, |
134 compilerConfiguration, |
132 config, |
135 config, |
133 wordTypes, |
136 wordTypes, |
134 metaAccess, |
137 metaAccess, |
135 constantReflection, |
138 constantReflection, |
136 snippetReflection, |
139 snippetReflection, |
137 foreignCalls, |
140 foreignCalls, |
138 replacements, |
141 replacements, |
139 options); |
142 options, |
140 SPARCGraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), false); |
143 target); |
|
144 SPARCGraphBuilderPlugins.register(plugins, replacements, false); |
141 return plugins; |
145 return plugins; |
142 } |
146 } |
143 |
147 |
144 /** |
148 /** |
145 * @param replacements |
149 * @param replacements |