| 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 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2410 Send selector = send.selector; | 2410 Send selector = send.selector; |
| 2411 if (selector.receiver is TypeAnnotation) { | 2411 if (selector.receiver is TypeAnnotation) { |
| 2412 return selector.receiver; | 2412 return selector.receiver; |
| 2413 } | 2413 } |
| 2414 } else { | 2414 } else { |
| 2415 compiler.internalError("malformed send in new expression"); | 2415 compiler.internalError("malformed send in new expression"); |
| 2416 } | 2416 } |
| 2417 } | 2417 } |
| 2418 | 2418 |
| 2419 visitNewExpression(NewExpression node) { | 2419 visitNewExpression(NewExpression node) { |
| 2420 if (node.isConst()) { | 2420 Element element = elements[node.send]; |
| 2421 if (Element.isInvalid(element)) { |
| 2422 // TODO(karlklose): generate runtime error or noSuchMethodCall, depending |
| 2423 // on whether element is null or it is an erroneous element with a |
| 2424 // particular error message. |
| 2425 compiler.cancel('Unimplemented unresolved constructor call', node: node); |
| 2426 } else if (node.isConst()) { |
| 2421 // TODO(karlklose): add type representation | 2427 // TODO(karlklose): add type representation |
| 2422 ConstantHandler handler = compiler.constantHandler; | 2428 ConstantHandler handler = compiler.constantHandler; |
| 2423 Constant constant = handler.compileNodeWithDefinitions(node, elements); | 2429 Constant constant = handler.compileNodeWithDefinitions(node, elements); |
| 2424 stack.add(graph.addConstant(constant)); | 2430 stack.add(graph.addConstant(constant)); |
| 2425 } else { | 2431 } else { |
| 2426 visitNewSend(node.send); | 2432 visitNewSend(node.send); |
| 2427 } | 2433 } |
| 2428 } | 2434 } |
| 2429 | 2435 |
| 2430 visitSendSet(SendSet node) { | 2436 visitSendSet(SendSet node) { |
| (...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3641 new HSubGraphBlockInformation(elseBranch.graph)); | 3647 new HSubGraphBlockInformation(elseBranch.graph)); |
| 3642 | 3648 |
| 3643 HBasicBlock conditionStartBlock = conditionBranch.block; | 3649 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 3644 conditionStartBlock.setBlockFlow(info, joinBlock); | 3650 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 3645 SubGraph conditionGraph = conditionBranch.graph; | 3651 SubGraph conditionGraph = conditionBranch.graph; |
| 3646 HIf branch = conditionGraph.end.last; | 3652 HIf branch = conditionGraph.end.last; |
| 3647 assert(branch is HIf); | 3653 assert(branch is HIf); |
| 3648 branch.blockInformation = conditionStartBlock.blockFlow; | 3654 branch.blockInformation = conditionStartBlock.blockFlow; |
| 3649 } | 3655 } |
| 3650 } | 3656 } |
| OLD | NEW |