| 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 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2939 } | 2939 } |
| 2940 HInstruction arguments = new HLiteralList(argumentValues); | 2940 HInstruction arguments = new HLiteralList(argumentValues); |
| 2941 add(arguments); | 2941 add(arguments); |
| 2942 pushInvokeHelper3(helper, receiver, name, arguments); | 2942 pushInvokeHelper3(helper, receiver, name, arguments); |
| 2943 } | 2943 } |
| 2944 | 2944 |
| 2945 visitNewExpression(NewExpression node) { | 2945 visitNewExpression(NewExpression node) { |
| 2946 Element element = elements[node.send]; | 2946 Element element = elements[node.send]; |
| 2947 if (Elements.isErroneousElement(element)) { | 2947 if (Elements.isErroneousElement(element)) { |
| 2948 ErroneousElement error = element; | 2948 ErroneousElement error = element; |
| 2949 Message message = error.errorMessage; | 2949 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR) { |
| 2950 if (message.kind == MessageKind.CANNOT_FIND_CONSTRUCTOR) { | |
| 2951 generateThrowNoSuchMethod(node.send, | 2950 generateThrowNoSuchMethod(node.send, |
| 2952 getTargetName(error, 'constructor'), | 2951 getTargetName(error, 'constructor'), |
| 2953 node.send.arguments); | 2952 node.send.arguments); |
| 2954 } else if (message.kind == MessageKind.CANNOT_RESOLVE) { | 2953 } else if (error.messageKind == MessageKind.CANNOT_RESOLVE) { |
| 2955 generateRuntimeError(node.send, message.message); | 2954 Message message = error.messageKind.message(error.messageArguments); |
| 2955 generateRuntimeError(node.send, message.toString()); |
| 2956 } else { | 2956 } else { |
| 2957 compiler.internalError('unexpected unresolved constructor call', | 2957 compiler.internalError('unexpected unresolved constructor call', |
| 2958 node: node); | 2958 node: node); |
| 2959 } | 2959 } |
| 2960 } else if (node.isConst()) { | 2960 } else if (node.isConst()) { |
| 2961 // TODO(karlklose): add type representation | 2961 // TODO(karlklose): add type representation |
| 2962 ConstantHandler handler = compiler.constantHandler; | 2962 ConstantHandler handler = compiler.constantHandler; |
| 2963 Constant constant = handler.compileNodeWithDefinitions(node, elements); | 2963 Constant constant = handler.compileNodeWithDefinitions(node, elements); |
| 2964 stack.add(graph.addConstant(constant)); | 2964 stack.add(graph.addConstant(constant)); |
| 2965 } else { | 2965 } else { |
| (...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4327 new HSubGraphBlockInformation(elseBranch.graph)); | 4327 new HSubGraphBlockInformation(elseBranch.graph)); |
| 4328 | 4328 |
| 4329 HBasicBlock conditionStartBlock = conditionBranch.block; | 4329 HBasicBlock conditionStartBlock = conditionBranch.block; |
| 4330 conditionStartBlock.setBlockFlow(info, joinBlock); | 4330 conditionStartBlock.setBlockFlow(info, joinBlock); |
| 4331 SubGraph conditionGraph = conditionBranch.graph; | 4331 SubGraph conditionGraph = conditionBranch.graph; |
| 4332 HIf branch = conditionGraph.end.last; | 4332 HIf branch = conditionGraph.end.last; |
| 4333 assert(branch is HIf); | 4333 assert(branch is HIf); |
| 4334 branch.blockInformation = conditionStartBlock.blockFlow; | 4334 branch.blockInformation = conditionStartBlock.blockFlow; |
| 4335 } | 4335 } |
| 4336 } | 4336 } |
| OLD | NEW |