Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java @ 16764:f9fff060dc41
Truffle-DSL: fixed behaviour of insertBefore to be more intuitive.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 11 Aug 2014 16:37:40 +0200 |
parents | 9f38d222fa6c |
children | 38d243eaad41 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Mon Aug 11 16:21:54 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Mon Aug 11 16:37:40 2014 +0200 @@ -580,21 +580,14 @@ specialization.setInsertBefore(found); } - int endIndex = specializations.size() - 1; - for (int i = endIndex; i >= 0; i--) { + for (int i = 0; i < specializations.size(); i++) { SpecializationData specialization = specializations.get(i); - if (specialization.isGeneric() || specialization.isPolymorphic()) { - endIndex--; - continue; - } - SpecializationData insertBefore = specialization.getInsertBefore(); if (insertBefore != null) { int insertIndex = specializations.indexOf(insertBefore); if (insertIndex < i) { - List<SpecializationData> range = new ArrayList<>(specializations.subList(i, endIndex + 1)); - specializations.removeAll(range); - specializations.addAll(insertIndex, range); + specializations.remove(i); + specializations.add(insertIndex, specialization); } } }