# HG changeset patch # User lagergren # Date 1409046127 -7200 # Node ID 136ee2110f5790deb8c643233b4e3c45bdf78c80 # Parent 4f3e221fd4ade2126ee9dfa0584209a6963bb2ca 8055906: Avoid throwing an exception with filled in stack trace as part of the normal control flow Reviewed-by: attila, hannesw diff -r 4f3e221fd4ad -r 136ee2110f57 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java Tue Aug 26 11:32:12 2014 +0200 +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ApplySpecialization.java Tue Aug 26 11:42:07 2014 +0200 @@ -35,6 +35,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; + import jdk.nashorn.internal.ir.AccessNode; import jdk.nashorn.internal.ir.CallNode; import jdk.nashorn.internal.ir.Expression; @@ -127,6 +128,14 @@ */ private boolean argumentsEscape(final FunctionNode functionNode) { + @SuppressWarnings("serial") + final UnsupportedOperationException uoe = new UnsupportedOperationException() { + @Override + public Throwable fillInStackTrace() { + return null; + } + }; + final Deque> stack = new ArrayDeque<>(); //ensure that arguments is only passed as arg to apply try { @@ -151,7 +160,7 @@ @Override public Node leaveIdentNode(final IdentNode identNode) { if (isParam(identNode.getName()) || ARGUMENTS.equals(identNode.getName()) && !isCurrentArg(identNode)) { - throw new UnsupportedOperationException(); + throw uoe; //avoid filling in stack trace } return identNode; }