# HG changeset patch # User Christian Humer # Date 1426018387 -3600 # Node ID 8caabd6cf363f62cd32ee2390519e6bd96a7e96c # Parent e6a4ba0980dd7e9038396e7e0c579334af371efb Truffle-DSL: removeSame does not need to run using atomic. It is always used in an atomic block already. diff -r e6a4ba0980dd -r 8caabd6cf363 graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java --- a/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java Tue Mar 10 21:11:12 2015 +0100 +++ b/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/SpecializationNode.java Tue Mar 10 21:13:07 2015 +0100 @@ -266,11 +266,18 @@ } protected final SpecializationNode removeSame(final CharSequence reason) { - return atomic(new Callable() { - public SpecializationNode call() throws Exception { - return removeSameImpl(SpecializationNode.this, reason); + SpecializationNode start = SpecializationNode.this.findStart(); + SpecializationNode current = start; + while (current != null) { + if (current.isSame(SpecializationNode.this)) { + NodeUtil.nonAtomicReplace(current, current.next, reason); + if (current == start) { + start = start.next; + } } - }); + current = current.next; + } + return SpecializationNode.this.findEnd().findStart(); } /** Find the topmost of the specialization chain. */ @@ -767,7 +774,7 @@ } public SpecializationNode call() throws Exception { - return removeSameImpl(source, this); + return source.removeSame(this); } } @@ -779,7 +786,7 @@ } public SpecializationNode call() throws Exception { - return removeSameImpl(source, this); + return source.removeSame(this); } } @@ -791,7 +798,7 @@ } public SpecializationNode call() throws Exception { - return removeSameImpl(source, this); + return source.removeSame(this); } } @@ -803,7 +810,7 @@ } public SpecializationNode call() throws Exception { - return removeSameImpl(source, this); + return source.removeSame(this); } } @@ -815,7 +822,7 @@ } public SpecializationNode call() throws Exception { - return removeSameImpl(source, this); + return source.removeSame(this); } } @@ -827,7 +834,7 @@ } public SpecializationNode call() throws Exception { - return removeSameImpl(source, this); + return source.removeSame(this); } } @@ -839,7 +846,7 @@ } public SpecializationNode call() throws Exception { - return removeSameImpl(source, this); + return source.removeSame(this); } }