| 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 2840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2851 } | 2851 } |
| 2852 HInstruction arguments = new HLiteralList(argumentValues); | 2852 HInstruction arguments = new HLiteralList(argumentValues); |
| 2853 add(arguments); | 2853 add(arguments); |
| 2854 pushInvokeHelper3(helper, receiver, name, arguments); | 2854 pushInvokeHelper3(helper, receiver, name, arguments); |
| 2855 } | 2855 } |
| 2856 | 2856 |
| 2857 visitNewExpression(NewExpression node) { | 2857 visitNewExpression(NewExpression node) { |
| 2858 Element element = elements[node.send]; | 2858 Element element = elements[node.send]; |
| 2859 if (Elements.isErroneousElement(element)) { | 2859 if (Elements.isErroneousElement(element)) { |
| 2860 ErroneousElement error = element; | 2860 ErroneousElement error = element; |
| 2861 Message message = error.errorMessage; | 2861 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR) { |
| 2862 if (message.kind == MessageKind.CANNOT_FIND_CONSTRUCTOR) { | |
| 2863 generateThrowNoSuchMethod(node.send, | 2862 generateThrowNoSuchMethod(node.send, |
| 2864 getTargetName(error, 'constructor'), | 2863 getTargetName(error, 'constructor'), |
| 2865 node.send.arguments); | 2864 node.send.arguments); |
| 2866 } else if (message.kind == MessageKind.CANNOT_RESOLVE) { | 2865 } else if (error.messageKind == MessageKind.CANNOT_RESOLVE) { |
| 2867 generateRuntimeError(node.send, message.message); | 2866 Message message = error.messageKind.message(error.messageArguments); |
| 2867 generateRuntimeError(node.send, message.toString()); |
| 2868 } else { | 2868 } else { |
| 2869 compiler.internalError('unexpected unresolved constructor call', | 2869 compiler.internalError('unexpected unresolved constructor call', |
| 2870 node: node); | 2870 node: node); |
| 2871 } | 2871 } |
| 2872 } else if (node.isConst()) { | 2872 } else if (node.isConst()) { |
| 2873 // TODO(karlklose): add type representation | 2873 // TODO(karlklose): add type representation |
| 2874 ConstantHandler handler = compiler.constantHandler; | 2874 ConstantHandler handler = compiler.constantHandler; |
| 2875 Constant constant = handler.compileNodeWithDefinitions(node, elements); | 2875 Constant constant = handler.compileNodeWithDefinitions(node, elements); |
| 2876 stack.add(graph.addConstant(constant)); | 2876 stack.add(graph.addConstant(constant)); |
| 2877 } else { | 2877 } else { |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4232 new HSubGraphBlockInformation(elseBranch.graph)); | 4232 new HSubGraphBlockInformation(elseBranch.graph)); |
| 4233 | 4233 |
| 4234 HBasicBlock conditionStartBlock = conditionBranch.block; | 4234 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 4235 conditionStartBlock.setBlockFlow(info, joinBlock); | 4235 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 4236 SubGraph conditionGraph = conditionBranch.graph; | 4236 SubGraph conditionGraph = conditionBranch.graph; |
| 4237 HIf branch = conditionGraph.end.last; | 4237 HIf branch = conditionGraph.end.last; |
| 4238 assert(branch is HIf); | 4238 assert(branch is HIf); |
| 4239 branch.blockInformation = conditionStartBlock.blockFlow; | 4239 branch.blockInformation = conditionStartBlock.blockFlow; |
| 4240 } | 4240 } |
| 4241 } | 4241 } |
| OLD | NEW |