Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/template/TemplateMethod.java @ 11193:6879565ee10b
Truffle-DSL: Fixed the second specialization is unreachable if two specializations have the exactly same signature (also guards) and are ordered next to each other.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Thu, 01 Aug 2013 20:52:03 +0200 |
parents | b8fe1fe004ec |
children | efe58aa92f86 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/template/TemplateMethod.java Thu Aug 01 20:48:56 2013 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/template/TemplateMethod.java Thu Aug 01 20:52:03 2013 +0200 @@ -216,6 +216,20 @@ return signature; } + public ActualParameter getSignatureParameter(int searchIndex) { + int index = 0; + for (ActualParameter parameter : getParameters()) { + if (!parameter.getSpecification().isSignature()) { + continue; + } + if (index == searchIndex) { + return parameter; + } + index++; + } + return null; + } + public void updateSignature(Signature signature) { assert signature.size() >= 1; int signatureIndex = 0; @@ -366,6 +380,13 @@ return signature; } + public boolean equalsParameters(Signature other) { + if (size() != other.size()) { + return false; + } + return types.subList(1, types.size()).equals(other.types.subList(1, other.types.size())); + } + @Override public boolean equals(Object obj) { if (obj instanceof Signature) {