| 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 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1968 // Example: A.f() or f() with 'f' bound to a static function. | 1968 // Example: A.f() or f() with 'f' bound to a static function. |
| 1969 // Also includes new A() or new A.named() which is treated like a | 1969 // Also includes new A() or new A.named() which is treated like a |
| 1970 // static call to a factory. | 1970 // static call to a factory. |
| 1971 visitStaticSend(node); | 1971 visitStaticSend(node); |
| 1972 } else { | 1972 } else { |
| 1973 compiler.internalError("Cannot generate code for send", node: node); | 1973 compiler.internalError("Cannot generate code for send", node: node); |
| 1974 } | 1974 } |
| 1975 } | 1975 } |
| 1976 } | 1976 } |
| 1977 | 1977 |
| 1978 visitNewExpression(NewExpression node) => visitSend(node.send); | 1978 visitNewExpression(NewExpression node) { |
| 1979 if (node.isConst()) { |
| 1980 ConstantHandler handler = compiler.constantHandler; |
| 1981 Constant constant = handler.compileNodeWithDefinitions(node, elements); |
| 1982 stack.add(graph.addConstant(constant)); |
| 1983 } else { |
| 1984 visitSend(node.send); |
| 1985 } |
| 1986 } |
| 1979 | 1987 |
| 1980 visitSendSet(SendSet node) { | 1988 visitSendSet(SendSet node) { |
| 1981 Operator op = node.assignmentOperator; | 1989 Operator op = node.assignmentOperator; |
| 1982 if (node.isSuperCall) { | 1990 if (node.isSuperCall) { |
| 1983 compiler.unimplemented('super property store', node: node); | 1991 compiler.unimplemented('super property store', node: node); |
| 1984 } else if (node.isIndex) { | 1992 } else if (node.isIndex) { |
| 1985 if (!methodInterceptionEnabled) { | 1993 if (!methodInterceptionEnabled) { |
| 1986 assert(op.source.stringValue === '='); | 1994 assert(op.source.stringValue === '='); |
| 1987 visitDynamicSend(node); | 1995 visitDynamicSend(node); |
| 1988 } else { | 1996 } else { |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2701 buildBody() { | 2709 buildBody() { |
| 2702 // TODO(lrn): Make sure to take continue into account. | 2710 // TODO(lrn): Make sure to take continue into account. |
| 2703 visit(body); | 2711 visit(body); |
| 2704 if (isAborted()) { | 2712 if (isAborted()) { |
| 2705 compiler.reportWarning(body, "aborting loop body"); | 2713 compiler.reportWarning(body, "aborting loop body"); |
| 2706 } | 2714 } |
| 2707 } | 2715 } |
| 2708 handleIf(buildBody, null); | 2716 handleIf(buildBody, null); |
| 2709 } | 2717 } |
| 2710 } | 2718 } |
| OLD | NEW |