Mercurial > hg > truffle
changeset 19855:edd37b7d6679
Turn a check for non-null stateAfter of an invoke into an assertion.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 14 Mar 2015 20:42:09 +0100 |
parents | 4178f9830a27 |
children | 63b6ad88b08f |
files | graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java |
diffstat | 2 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Sat Mar 14 19:15:51 2015 +0100 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Node.java Sat Mar 14 20:42:09 2015 +0100 @@ -884,18 +884,22 @@ if (condition) { return true; } else { - throw new VerificationError(message, args).addContext(this); + throw fail(message, args); } } public boolean assertFalse(boolean condition, String message, Object... args) { if (condition) { - throw new VerificationError(message, args).addContext(this); + throw fail(message, args); } else { return true; } } + protected VerificationError fail(String message, Object... args) throws GraalGraphInternalError { + throw new VerificationError(message, args).addContext(this); + } + public Iterable<? extends Node> cfgPredecessors() { if (predecessor == null) { return Collections.emptySet();
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Sat Mar 14 19:15:51 2015 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Sat Mar 14 20:42:09 2015 +0100 @@ -211,10 +211,7 @@ if (callTarget.targetMethod() == null) { return "target method is null"; } - if (invoke.stateAfter() == null) { - // TODO (chaeubl): why should an invoke not have a state after? - return "the invoke has no after state"; - } + assert invoke.stateAfter() != null; if (!invoke.useForInlining()) { return "the invoke is marked to be not used for inlining"; }