# HG changeset patch # User attila # Date 1415800480 -3600 # Node ID 56c0d55ea56275b35190d38c9a5ad0e12f3a2221 # Parent 6c2680043f5be2d7db7e2f3000ebb0c36826a8dc 8063037: ApplySpecialization.hasApplies shouuld not descend into nested functions Reviewed-by: hannesw, lagergren diff -r 6c2680043f5b -r 56c0d55ea562 src/jdk/nashorn/internal/codegen/ApplySpecialization.java --- a/src/jdk/nashorn/internal/codegen/ApplySpecialization.java Tue Nov 11 10:39:52 2014 -0800 +++ b/src/jdk/nashorn/internal/codegen/ApplySpecialization.java Wed Nov 12 14:54:40 2014 +0100 @@ -141,6 +141,11 @@ try { functionNode.accept(new NodeVisitor(new LexicalContext()) { @Override + public boolean enterFunctionNode(final FunctionNode fn) { + return fn == functionNode; + } + + @Override public boolean enterCallNode(final CallNode callNode) { if (isApply(callNode)) { throw HAS_APPLIES; @@ -162,7 +167,7 @@ * scope, thus we are conservative and treat any access to arguments outside the * apply call as a case of "we cannot apply the optimization". */ - private void checkValidTransform(final FunctionNode functionNode) { + private static void checkValidTransform(final FunctionNode functionNode) { final Set argumentsFound = new HashSet<>(); final Deque> stack = new ArrayDeque<>();