comparison graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java @ 19254:835e950b38b9

removed vestige usages of Assumptions independent of a StructuredGraph
author Doug Simon <doug.simon@oracle.com>
date Wed, 11 Feb 2015 13:39:33 +0100
parents 8ab925a6f724
children a0a760b0fb5f
comparison
equal deleted inserted replaced
19253:2caf12d746a3 19254:835e950b38b9
62 public class ReplacementsImpl implements Replacements { 62 public class ReplacementsImpl implements Replacements {
63 63
64 public final Providers providers; 64 public final Providers providers;
65 public final SnippetReflectionProvider snippetReflection; 65 public final SnippetReflectionProvider snippetReflection;
66 public final TargetDescription target; 66 public final TargetDescription target;
67 public final Assumptions assumptions;
68 67
69 /** 68 /**
70 * The preprocessed replacement graphs. 69 * The preprocessed replacement graphs.
71 */ 70 */
72 protected final ConcurrentMap<ResolvedJavaMethod, StructuredGraph> graphs; 71 protected final ConcurrentMap<ResolvedJavaMethod, StructuredGraph> graphs;
218 217
219 // This map is key'ed by a class name instead of a Class object so that 218 // This map is key'ed by a class name instead of a Class object so that
220 // it is stable across VM executions (in support of replay compilation). 219 // it is stable across VM executions (in support of replay compilation).
221 private final Map<String, SnippetTemplateCache> snippetTemplateCache; 220 private final Map<String, SnippetTemplateCache> snippetTemplateCache;
222 221
223 public ReplacementsImpl(Providers providers, SnippetReflectionProvider snippetReflection, Assumptions assumptions, TargetDescription target) { 222 public ReplacementsImpl(Providers providers, SnippetReflectionProvider snippetReflection, TargetDescription target) {
224 this.providers = providers.copyWith(this); 223 this.providers = providers.copyWith(this);
225 this.classReplacements = CollectionsFactory.newMap(); 224 this.classReplacements = CollectionsFactory.newMap();
226 this.internalNameToSubstitutionClasses = CollectionsFactory.newMap(); 225 this.internalNameToSubstitutionClasses = CollectionsFactory.newMap();
227 this.snippetReflection = snippetReflection; 226 this.snippetReflection = snippetReflection;
228 this.target = target; 227 this.target = target;
229 this.assumptions = assumptions;
230 this.graphs = new ConcurrentHashMap<>(); 228 this.graphs = new ConcurrentHashMap<>();
231 this.snippetTemplateCache = CollectionsFactory.newMap(); 229 this.snippetTemplateCache = CollectionsFactory.newMap();
232 } 230 }
233 231
234 private static final boolean UseSnippetGraphCache = Boolean.parseBoolean(System.getProperty("graal.useSnippetGraphCache", "true")); 232 private static final boolean UseSnippetGraphCache = Boolean.parseBoolean(System.getProperty("graal.useSnippetGraphCache", "true"));
316 } 314 }
317 315
318 public Class<? extends FixedWithNextNode> getMacroSubstitution(ResolvedJavaMethod method) { 316 public Class<? extends FixedWithNextNode> getMacroSubstitution(ResolvedJavaMethod method) {
319 ClassReplacements cr = getClassReplacements(method.getDeclaringClass().getName()); 317 ClassReplacements cr = getClassReplacements(method.getDeclaringClass().getName());
320 return cr == null ? null : cr.macroSubstitutions.get(method); 318 return cr == null ? null : cr.macroSubstitutions.get(method);
321 }
322
323 public Assumptions getAssumptions() {
324 return assumptions;
325 } 319 }
326 320
327 private SubstitutionGuard getGuard(Class<? extends SubstitutionGuard> guardClass) { 321 private SubstitutionGuard getGuard(Class<? extends SubstitutionGuard> guardClass) {
328 if (guardClass != SubstitutionGuard.class) { 322 if (guardClass != SubstitutionGuard.class) {
329 Constructor<?>[] constructors = guardClass.getConstructors(); 323 Constructor<?>[] constructors = guardClass.getConstructors();