src/jdk/nashorn/internal/codegen/MethodEmitter.java

changeset 118
927fba6785b0
parent 108
a971adb68f38
child 144
4be452026847
equal deleted inserted replaced
117:5452f82eb2ce 118:927fba6785b0
82 import jdk.nashorn.internal.ir.LiteralNode; 82 import jdk.nashorn.internal.ir.LiteralNode;
83 import jdk.nashorn.internal.ir.RuntimeNode; 83 import jdk.nashorn.internal.ir.RuntimeNode;
84 import jdk.nashorn.internal.ir.SplitNode; 84 import jdk.nashorn.internal.ir.SplitNode;
85 import jdk.nashorn.internal.ir.Symbol; 85 import jdk.nashorn.internal.ir.Symbol;
86 import jdk.nashorn.internal.runtime.ArgumentSetter; 86 import jdk.nashorn.internal.runtime.ArgumentSetter;
87 import jdk.nashorn.internal.runtime.Context;
88 import jdk.nashorn.internal.runtime.DebugLogger; 87 import jdk.nashorn.internal.runtime.DebugLogger;
89 import jdk.nashorn.internal.runtime.JSType; 88 import jdk.nashorn.internal.runtime.JSType;
90 import jdk.nashorn.internal.runtime.Scope; 89 import jdk.nashorn.internal.runtime.Scope;
90 import jdk.nashorn.internal.runtime.ScriptEnvironment;
91 import jdk.nashorn.internal.runtime.ScriptObject; 91 import jdk.nashorn.internal.runtime.ScriptObject;
92 import jdk.nashorn.internal.runtime.linker.Bootstrap; 92 import jdk.nashorn.internal.runtime.linker.Bootstrap;
93 import jdk.nashorn.internal.runtime.options.Options; 93 import jdk.nashorn.internal.runtime.options.Options;
94 94
95 /** 95 /**
119 private FunctionNode functionNode; 119 private FunctionNode functionNode;
120 120
121 /** SplitNode representing the current split, or null if none exists */ 121 /** SplitNode representing the current split, or null if none exists */
122 private SplitNode splitNode; 122 private SplitNode splitNode;
123 123
124 /** The context */ 124 /** The script environment */
125 private final Context context; 125 private final ScriptEnvironment env;
126 126
127 /** Threshold in chars for when string constants should be split */ 127 /** Threshold in chars for when string constants should be split */
128 static final int LARGE_STRING_THRESHOLD = 32 * 1024; 128 static final int LARGE_STRING_THRESHOLD = 32 * 1024;
129 129
130 /** Debug flag, should we dump all generated bytecode along with stacks? */ 130 /** Debug flag, should we dump all generated bytecode along with stacks? */
169 * @param classEmitter the class emitter weaving the class this method is in 169 * @param classEmitter the class emitter weaving the class this method is in
170 * @param method a method visitor 170 * @param method a method visitor
171 * @param functionNode a function node representing this method 171 * @param functionNode a function node representing this method
172 */ 172 */
173 MethodEmitter(final ClassEmitter classEmitter, final MethodVisitor method, final FunctionNode functionNode) { 173 MethodEmitter(final ClassEmitter classEmitter, final MethodVisitor method, final FunctionNode functionNode) {
174 this.context = classEmitter.getContext(); 174 this.env = classEmitter.getEnv();
175 this.classEmitter = classEmitter; 175 this.classEmitter = classEmitter;
176 this.method = method; 176 this.method = method;
177 this.functionNode = functionNode; 177 this.functionNode = functionNode;
178 this.stack = null; 178 this.stack = null;
179 } 179 }
2235 for (final Object arg : args) { 2235 for (final Object arg : args) {
2236 sb.append(arg); 2236 sb.append(arg);
2237 sb.append(' '); 2237 sb.append(' ');
2238 } 2238 }
2239 2239
2240 if (context != null) { //early bootstrap code doesn't have inited context yet 2240 if (env != null) { //early bootstrap code doesn't have inited context yet
2241 LOG.info(sb.toString()); 2241 LOG.info(sb.toString());
2242 if (DEBUG_TRACE_LINE == linePrefix) { 2242 if (DEBUG_TRACE_LINE == linePrefix) {
2243 new Throwable().printStackTrace(LOG.getOutputStream()); 2243 new Throwable().printStackTrace(LOG.getOutputStream());
2244 } 2244 }
2245 } 2245 }

mercurial