# HG changeset patch # User Christian Humer # Date 1433847043 -7200 # Node ID 79fb8b5ef18592db150b0c97913cfe798bfc5305 # Parent 23f0f181bc052bf3703360765d982af77394495c Truffle-DSL: compute UnsupportedSpecializationException message lazily; Add a @TruffleBoundary to its constructor as it may end up on the fast path. diff -r 23f0f181bc05 -r 79fb8b5ef185 graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/UnsupportedSpecializationException.java --- a/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/UnsupportedSpecializationException.java Tue Jun 09 12:50:43 2015 +0200 +++ b/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/UnsupportedSpecializationException.java Tue Jun 09 12:50:43 2015 +0200 @@ -26,6 +26,7 @@ import java.util.*; +import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; import com.oracle.truffle.api.nodes.*; /** @@ -40,8 +41,8 @@ private final Node[] suppliedNodes; private final Object[] suppliedValues; + @TruffleBoundary public UnsupportedSpecializationException(Node node, Node[] suppliedNodes, Object... suppliedValues) { - super("Unexpected values provided for " + node + ": " + Arrays.toString(suppliedValues)); Objects.requireNonNull(suppliedNodes, "The suppliedNodes parameter must not be null."); if (suppliedNodes.length != suppliedValues.length) { throw new IllegalArgumentException("The length of suppliedNodes must match the length of suppliedValues."); @@ -51,6 +52,11 @@ this.suppliedValues = suppliedValues; } + @Override + public String getMessage() { + return String.format("Unexpected values provided for %s: %s", node, Arrays.toString(suppliedValues)); + } + /** * Returns the {@link Node} that caused the this {@link UnsupportedSpecializationException}. */