Splitter.java (1321:8f389acf77f0) Splitter.java (1426:751ada854e5a)
1/*
2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided

--- 19 unchanged lines hidden (view full) ---

28import static jdk.nashorn.internal.codegen.CompilerConstants.SPLIT_PREFIX;
29
30import java.util.ArrayList;
31import java.util.HashMap;
32import java.util.List;
33import java.util.Map;
34import jdk.nashorn.internal.ir.Block;
35import jdk.nashorn.internal.ir.FunctionNode;
1/*
2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided

--- 19 unchanged lines hidden (view full) ---

28import static jdk.nashorn.internal.codegen.CompilerConstants.SPLIT_PREFIX;
29
30import java.util.ArrayList;
31import java.util.HashMap;
32import java.util.List;
33import java.util.Map;
34import jdk.nashorn.internal.ir.Block;
35import jdk.nashorn.internal.ir.FunctionNode;
36import jdk.nashorn.internal.ir.FunctionNode.CompilationState;
37import jdk.nashorn.internal.ir.LexicalContext;
38import jdk.nashorn.internal.ir.LiteralNode;
39import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
40import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode.ArrayUnit;
41import jdk.nashorn.internal.ir.Node;
42import jdk.nashorn.internal.ir.SplitNode;
43import jdk.nashorn.internal.ir.Statement;
44import jdk.nashorn.internal.ir.visitor.NodeVisitor;

--- 108 unchanged lines hidden (view full) ---

153 lc.replace(nestedFunction, split);
154 return split;
155 }
156 });
157 functionNode = functionNode.setBody(null, newBody);
158
159 assert functionNode.getCompileUnit() != null;
160
36import jdk.nashorn.internal.ir.LexicalContext;
37import jdk.nashorn.internal.ir.LiteralNode;
38import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode;
39import jdk.nashorn.internal.ir.LiteralNode.ArrayLiteralNode.ArrayUnit;
40import jdk.nashorn.internal.ir.Node;
41import jdk.nashorn.internal.ir.SplitNode;
42import jdk.nashorn.internal.ir.Statement;
43import jdk.nashorn.internal.ir.visitor.NodeVisitor;

--- 108 unchanged lines hidden (view full) ---

152 lc.replace(nestedFunction, split);
153 return split;
154 }
155 });
156 functionNode = functionNode.setBody(null, newBody);
157
158 assert functionNode.getCompileUnit() != null;
159
161 return functionNode.setState(null, CompilationState.SPLIT);
160 return functionNode;
162 }
163
164 private static List<FunctionNode> directChildren(final FunctionNode functionNode) {
165 final List<FunctionNode> dc = new ArrayList<>();
166 functionNode.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
167 @Override
168 public boolean enterFunctionNode(final FunctionNode child) {
169 if (child == functionNode) {

--- 167 unchanged lines hidden ---
161 }
162
163 private static List<FunctionNode> directChildren(final FunctionNode functionNode) {
164 final List<FunctionNode> dc = new ArrayList<>();
165 functionNode.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) {
166 @Override
167 public boolean enterFunctionNode(final FunctionNode child) {
168 if (child == functionNode) {

--- 167 unchanged lines hidden ---