127 import jdk.nashorn.internal.ir.UnaryNode; |
127 import jdk.nashorn.internal.ir.UnaryNode; |
128 import jdk.nashorn.internal.ir.VarNode; |
128 import jdk.nashorn.internal.ir.VarNode; |
129 import jdk.nashorn.internal.ir.WhileNode; |
129 import jdk.nashorn.internal.ir.WhileNode; |
130 import jdk.nashorn.internal.ir.WithNode; |
130 import jdk.nashorn.internal.ir.WithNode; |
131 import jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor; |
131 import jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor; |
132 import jdk.nashorn.internal.ir.visitor.NodeVisitor; |
132 import jdk.nashorn.internal.ir.visitor.SimpleNodeVisitor; |
133 import jdk.nashorn.internal.objects.Global; |
133 import jdk.nashorn.internal.objects.Global; |
134 import jdk.nashorn.internal.parser.Lexer.RegexToken; |
134 import jdk.nashorn.internal.parser.Lexer.RegexToken; |
135 import jdk.nashorn.internal.parser.TokenType; |
135 import jdk.nashorn.internal.parser.TokenType; |
136 import jdk.nashorn.internal.runtime.Context; |
136 import jdk.nashorn.internal.runtime.Context; |
137 import jdk.nashorn.internal.runtime.Debug; |
137 import jdk.nashorn.internal.runtime.Debug; |
1431 final List<Expression> args = callNode.getArgs(); |
1431 final List<Expression> args = callNode.getArgs(); |
1432 final Expression function = callNode.getFunction(); |
1432 final Expression function = callNode.getFunction(); |
1433 final Block currentBlock = lc.getCurrentBlock(); |
1433 final Block currentBlock = lc.getCurrentBlock(); |
1434 final CodeGeneratorLexicalContext codegenLexicalContext = lc; |
1434 final CodeGeneratorLexicalContext codegenLexicalContext = lc; |
1435 |
1435 |
1436 function.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) { |
1436 function.accept(new SimpleNodeVisitor() { |
1437 |
|
1438 private MethodEmitter sharedScopeCall(final IdentNode identNode, final int flags) { |
1437 private MethodEmitter sharedScopeCall(final IdentNode identNode, final int flags) { |
1439 final Symbol symbol = identNode.getSymbol(); |
1438 final Symbol symbol = identNode.getSymbol(); |
1440 final boolean isFastScope = isFastScope(symbol); |
1439 final boolean isFastScope = isFastScope(symbol); |
1441 new OptimisticOperation(callNode, resultBounds) { |
1440 new OptimisticOperation(callNode, resultBounds) { |
1442 @Override |
1441 @Override |
4345 /* |
4344 /* |
4346 * This loads the parts of the target, e.g base and index. they are kept |
4345 * This loads the parts of the target, e.g base and index. they are kept |
4347 * on the stack throughout the store and used at the end to execute it |
4346 * on the stack throughout the store and used at the end to execute it |
4348 */ |
4347 */ |
4349 |
4348 |
4350 target.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) { |
4349 target.accept(new SimpleNodeVisitor() { |
4351 @Override |
4350 @Override |
4352 public boolean enterIdentNode(final IdentNode node) { |
4351 public boolean enterIdentNode(final IdentNode node) { |
4353 if (node.getSymbol().isScope()) { |
4352 if (node.getSymbol().isScope()) { |
4354 method.loadCompilerConstant(SCOPE); |
4353 method.loadCompilerConstant(SCOPE); |
4355 depth += Type.SCOPE.getSlots(); |
4354 depth += Type.SCOPE.getSlots(); |
4444 * |
4443 * |
4445 * The case that targetSymbol is in scope (!hasSlot) and we actually |
4444 * The case that targetSymbol is in scope (!hasSlot) and we actually |
4446 * need to do a conversion on non-equivalent types exists, but is |
4445 * need to do a conversion on non-equivalent types exists, but is |
4447 * very rare. See for example test/script/basic/access-specializer.js |
4446 * very rare. See for example test/script/basic/access-specializer.js |
4448 */ |
4447 */ |
4449 target.accept(new NodeVisitor<LexicalContext>(new LexicalContext()) { |
4448 target.accept(new SimpleNodeVisitor() { |
4450 @Override |
4449 @Override |
4451 protected boolean enterDefault(final Node node) { |
4450 protected boolean enterDefault(final Node node) { |
4452 throw new AssertionError("Unexpected node " + node + " in store epilogue"); |
4451 throw new AssertionError("Unexpected node " + node + " in store epilogue"); |
4453 } |
4452 } |
4454 |
4453 |