Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeParser.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 | 7a8835ec5e7d |
children | 4830676526e3 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeParser.java Thu Aug 01 20:48:56 2013 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeParser.java Thu Aug 01 20:52:03 2013 +0200 @@ -665,6 +665,7 @@ } // calculate reachability + SpecializationData prev = null; int specializationCount = 0; boolean reachable = true; for (SpecializationData specialization : specializations) { @@ -672,7 +673,9 @@ specialization.setReachable(true); continue; } - if (!reachable && specialization.getMethod() != null) { + if (prev != null && prev.equalsGuards(specialization) && prev.getExceptions().isEmpty()) { + specialization.addError("%s is not reachable.", specialization.isGeneric() ? "Generic" : "Specialization"); + } else if (!reachable && specialization.getMethod() != null) { specialization.addError("%s is not reachable.", specialization.isGeneric() ? "Generic" : "Specialization"); } specialization.setReachable(reachable); @@ -682,6 +685,7 @@ if (!specialization.isGeneric()) { specializationCount++; } + prev = specialization; } // initialize polymorphic depth