Mercurial > hg > truffle
comparison graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java @ 9916:491cd7d69539
CanonicalizerPhase: remove it from context, add it to tiers instead and configure/pass it there (GRAAL-309)
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Thu, 06 Jun 2013 16:30:41 +0200 |
parents | fc93d919f896 |
children | 23ccaa863eda |
comparison
equal
deleted
inserted
replaced
9915:d8a8d794f631 | 9916:491cd7d69539 |
---|---|
22 */ | 22 */ |
23 package com.oracle.graal.phases.tiers; | 23 package com.oracle.graal.phases.tiers; |
24 | 24 |
25 import com.oracle.graal.api.code.*; | 25 import com.oracle.graal.api.code.*; |
26 import com.oracle.graal.api.meta.*; | 26 import com.oracle.graal.api.meta.*; |
27 import com.oracle.graal.nodes.*; | |
28 import com.oracle.graal.nodes.spi.*; | 27 import com.oracle.graal.nodes.spi.*; |
29 import com.oracle.graal.phases.*; | |
30 | 28 |
31 public class PhaseContext { | 29 public class PhaseContext { |
32 | 30 |
33 private final MetaAccessProvider runtime; | 31 private final MetaAccessProvider runtime; |
34 private final Assumptions assumptions; | 32 private final Assumptions assumptions; |
35 private final Replacements replacements; | 33 private final Replacements replacements; |
36 private final BasePhase<PhaseContext> canonicalizer; | |
37 | 34 |
38 public PhaseContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements, BasePhase<PhaseContext> canonicalizer) { | 35 public PhaseContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements) { |
39 this.runtime = runtime; | 36 this.runtime = runtime; |
40 this.assumptions = assumptions; | 37 this.assumptions = assumptions; |
41 this.replacements = replacements; | 38 this.replacements = replacements; |
42 this.canonicalizer = canonicalizer; | |
43 } | 39 } |
44 | 40 |
45 public MetaAccessProvider getRuntime() { | 41 public MetaAccessProvider getRuntime() { |
46 return runtime; | 42 return runtime; |
47 } | 43 } |
51 } | 47 } |
52 | 48 |
53 public Replacements getReplacements() { | 49 public Replacements getReplacements() { |
54 return replacements; | 50 return replacements; |
55 } | 51 } |
56 | |
57 private BasePhase<PhaseContext> getCanonicalizer() { | |
58 return canonicalizer; | |
59 } | |
60 | |
61 public void applyCanonicalizer(StructuredGraph graph) { | |
62 getCanonicalizer().apply(graph, this); | |
63 } | |
64 } | 52 } |