Mercurial > hg > truffle
comparison graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java @ 17054:fb8fe09c00a3
Don't remove LoopExitNodes in UseTrappingNullChecksPhase.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Fri, 05 Sep 2014 12:27:04 +0200 |
parents | 06c15e88d383 |
children | 45b45f902bed |
comparison
equal
deleted
inserted
replaced
17053:7404e1113697 | 17054:fb8fe09c00a3 |
---|---|
170 * We now have the pattern NullCheck/BeginNode/... It's possible some node is using the | 170 * We now have the pattern NullCheck/BeginNode/... It's possible some node is using the |
171 * BeginNode as a guard input, so replace guard users of the Begin with the NullCheck and | 171 * BeginNode as a guard input, so replace guard users of the Begin with the NullCheck and |
172 * then remove the Begin from the graph. | 172 * then remove the Begin from the graph. |
173 */ | 173 */ |
174 nonTrappingContinuation.replaceAtUsages(InputType.Guard, trappingNullCheck); | 174 nonTrappingContinuation.replaceAtUsages(InputType.Guard, trappingNullCheck); |
175 FixedNode next = nonTrappingContinuation.next(); | 175 if (nonTrappingContinuation.getNodeClass().is(BeginNode.class)) { |
176 nonTrappingContinuation.clearSuccessors(); | 176 FixedNode next = nonTrappingContinuation.next(); |
177 trappingNullCheck.setNext(next); | 177 nonTrappingContinuation.clearSuccessors(); |
178 nonTrappingContinuation.safeDelete(); | 178 trappingNullCheck.setNext(next); |
179 nonTrappingContinuation.safeDelete(); | |
180 } else { | |
181 trappingNullCheck.setNext(nonTrappingContinuation); | |
182 } | |
179 | 183 |
180 GraphUtil.killCFG(trappingContinuation); | 184 GraphUtil.killCFG(trappingContinuation); |
181 if (isNullNode.usages().isEmpty()) { | 185 if (isNullNode.usages().isEmpty()) { |
182 GraphUtil.killWithUnusedFloatingInputs(isNullNode); | 186 GraphUtil.killWithUnusedFloatingInputs(isNullNode); |
183 } | 187 } |