Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java @ 9906:fc93d919f896
PhaseContext: add an instance of CanonicalizerPhase to context
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Wed, 05 Jun 2013 21:17:38 +0200 |
parents | bff0abdbc8b6 |
children | 491cd7d69539 |
comparison
equal
deleted
inserted
replaced
9905:97cabe2c4642 | 9906:fc93d919f896 |
---|---|
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.*; | |
27 import com.oracle.graal.nodes.spi.*; | 28 import com.oracle.graal.nodes.spi.*; |
29 import com.oracle.graal.phases.*; | |
28 | 30 |
29 public class PhaseContext { | 31 public class PhaseContext { |
30 | 32 |
31 private final MetaAccessProvider runtime; | 33 private final MetaAccessProvider runtime; |
32 private final Assumptions assumptions; | 34 private final Assumptions assumptions; |
33 private final Replacements replacements; | 35 private final Replacements replacements; |
36 private final BasePhase<PhaseContext> canonicalizer; | |
34 | 37 |
35 public PhaseContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements) { | 38 public PhaseContext(MetaAccessProvider runtime, Assumptions assumptions, Replacements replacements, BasePhase<PhaseContext> canonicalizer) { |
36 this.runtime = runtime; | 39 this.runtime = runtime; |
37 this.assumptions = assumptions; | 40 this.assumptions = assumptions; |
38 this.replacements = replacements; | 41 this.replacements = replacements; |
42 this.canonicalizer = canonicalizer; | |
39 } | 43 } |
40 | 44 |
41 public MetaAccessProvider getRuntime() { | 45 public MetaAccessProvider getRuntime() { |
42 return runtime; | 46 return runtime; |
43 } | 47 } |
47 } | 51 } |
48 | 52 |
49 public Replacements getReplacements() { | 53 public Replacements getReplacements() { |
50 return replacements; | 54 return replacements; |
51 } | 55 } |
56 | |
57 private BasePhase<PhaseContext> getCanonicalizer() { | |
58 return canonicalizer; | |
59 } | |
60 | |
61 public void applyCanonicalizer(StructuredGraph graph) { | |
62 getCanonicalizer().apply(graph, this); | |
63 } | |
52 } | 64 } |