| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 class Interceptors { | 5 class Interceptors { |
| 6 Compiler compiler; | 6 Compiler compiler; |
| 7 Interceptors(Compiler this.compiler); | 7 Interceptors(Compiler this.compiler); |
| 8 | 8 |
| 9 SourceString mapOperatorToMethodName(Operator op) { | 9 SourceString mapOperatorToMethodName(Operator op) { |
| 10 String name = op.source.stringValue; | 10 String name = op.source.stringValue; |
| (...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1976 // Example: A.f() or f() with 'f' bound to a static function. | 1976 // Example: A.f() or f() with 'f' bound to a static function. |
| 1977 // Also includes new A() or new A.named() which is treated like a | 1977 // Also includes new A() or new A.named() which is treated like a |
| 1978 // static call to a factory. | 1978 // static call to a factory. |
| 1979 visitStaticSend(node); | 1979 visitStaticSend(node); |
| 1980 } else { | 1980 } else { |
| 1981 compiler.internalError("Cannot generate code for send", node: node); | 1981 compiler.internalError("Cannot generate code for send", node: node); |
| 1982 } | 1982 } |
| 1983 } | 1983 } |
| 1984 } | 1984 } |
| 1985 | 1985 |
| 1986 visitNewExpression(NewExpression node) => visitSend(node.send); | 1986 visitNewExpression(NewExpression node) { |
| 1987 if (node.isConst()) { |
| 1988 ConstantHandler handler = compiler.constantHandler; |
| 1989 Constant constant = handler.compileNodeWithDefinitions(node, elements); |
| 1990 stack.add(graph.addConstant(constant)); |
| 1991 } else { |
| 1992 visitSend(node.send); |
| 1993 } |
| 1994 } |
| 1987 | 1995 |
| 1988 visitSendSet(SendSet node) { | 1996 visitSendSet(SendSet node) { |
| 1989 Operator op = node.assignmentOperator; | 1997 Operator op = node.assignmentOperator; |
| 1990 if (node.isSuperCall) { | 1998 if (node.isSuperCall) { |
| 1991 compiler.unimplemented('super property store', node: node); | 1999 compiler.unimplemented('super property store', node: node); |
| 1992 } else if (node.isIndex) { | 2000 } else if (node.isIndex) { |
| 1993 if (!methodInterceptionEnabled) { | 2001 if (!methodInterceptionEnabled) { |
| 1994 assert(op.source.stringValue === '='); | 2002 assert(op.source.stringValue === '='); |
| 1995 visitDynamicSend(node); | 2003 visitDynamicSend(node); |
| 1996 } else { | 2004 } else { |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2810 HInstruction concat = new HAdd(target, left, right); | 2818 HInstruction concat = new HAdd(target, left, right); |
| 2811 builder.add(concat); | 2819 builder.add(concat); |
| 2812 return concat; | 2820 return concat; |
| 2813 } | 2821 } |
| 2814 | 2822 |
| 2815 HInstruction result() { | 2823 HInstruction result() { |
| 2816 flushAccumulator(); | 2824 flushAccumulator(); |
| 2817 return prefix; | 2825 return prefix; |
| 2818 } | 2826 } |
| 2819 } | 2827 } |
| OLD | NEW |