Mercurial > hg > truffle
comparison graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/GraphEffectList.java @ 19359:afe80ca4b0f0
cache EscapeObjectStates during PEA
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Fri, 13 Feb 2015 17:42:58 +0100 |
parents | a657c513e128 |
children | 9d5003af91f5 |
comparison
equal
deleted
inserted
replaced
19358:5ea169a3bf81 | 19359:afe80ca4b0f0 |
---|---|
106 */ | 106 */ |
107 public void addVirtualMapping(final FrameState node, final EscapeObjectState state) { | 107 public void addVirtualMapping(final FrameState node, final EscapeObjectState state) { |
108 add("add virtual mapping", new Effect() { | 108 add("add virtual mapping", new Effect() { |
109 @Override | 109 @Override |
110 public void apply(StructuredGraph graph, ArrayList<Node> obsoleteNodes) { | 110 public void apply(StructuredGraph graph, ArrayList<Node> obsoleteNodes) { |
111 assert node.isAlive() && !state.isAlive() && !state.isDeleted(); | 111 assert node.isAlive() && !state.isDeleted(); |
112 FrameState stateAfter = node; | 112 FrameState stateAfter = node; |
113 for (int i = 0; i < stateAfter.virtualObjectMappingCount(); i++) { | 113 for (int i = 0; i < stateAfter.virtualObjectMappingCount(); i++) { |
114 if (stateAfter.virtualObjectMappingAt(i).object() == state.object()) { | 114 if (stateAfter.virtualObjectMappingAt(i).object() == state.object()) { |
115 stateAfter.virtualObjectMappings().remove(i); | 115 stateAfter.virtualObjectMappings().remove(i); |
116 } | 116 } |
117 } | 117 } |
118 stateAfter.addVirtualObjectMapping(graph.unique(state)); | 118 stateAfter.addVirtualObjectMapping(state.isAlive() ? state : graph.unique(state)); |
119 } | 119 } |
120 | 120 |
121 @Override | 121 @Override |
122 public boolean isVisible() { | 122 public boolean isVisible() { |
123 return false; | 123 return false; |