| 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 2337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2348 } else if (element.isGenerativeConstructor()) { | 2348 } else if (element.isGenerativeConstructor()) { |
| 2349 ClassElement cls = element.enclosingElement; | 2349 ClassElement cls = element.enclosingElement; |
| 2350 return new HBoundedType.exact(cls.type); | 2350 return new HBoundedType.exact(cls.type); |
| 2351 } else { | 2351 } else { |
| 2352 return HType.UNKNOWN; | 2352 return HType.UNKNOWN; |
| 2353 } | 2353 } |
| 2354 } | 2354 } |
| 2355 | 2355 |
| 2356 Selector selector = elements.getSelector(node); | 2356 Selector selector = elements.getSelector(node); |
| 2357 Element element = elements[node]; | 2357 Element element = elements[node]; |
| 2358 compiler.resolver.resolveMethodElement(element); | 2358 if (compiler.enqueuer.resolution.getCachedElements(element) === null) { |
| 2359 compiler.internalError("Unresolved element: $element", node: node); |
| 2360 } |
| 2359 FunctionElement functionElement = element; | 2361 FunctionElement functionElement = element; |
| 2360 element = functionElement.defaultImplementation; | 2362 element = functionElement.defaultImplementation; |
| 2361 HInstruction target = new HStatic(element); | 2363 HInstruction target = new HStatic(element); |
| 2362 add(target); | 2364 add(target); |
| 2363 var inputs = <HInstruction>[]; | 2365 var inputs = <HInstruction>[]; |
| 2364 inputs.add(target); | 2366 inputs.add(target); |
| 2365 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, | 2367 bool succeeded = addStaticSendArgumentsToList(selector, node.arguments, |
| 2366 element, inputs); | 2368 element, inputs); |
| 2367 if (!succeeded) { | 2369 if (!succeeded) { |
| 2368 // TODO(ngeoffray): Match the VM behavior and throw an | 2370 // TODO(ngeoffray): Match the VM behavior and throw an |
| (...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3460 void visitNodeList(NodeList node) { | 3462 void visitNodeList(NodeList node) { |
| 3461 node.visitChildren(this); | 3463 node.visitChildren(this); |
| 3462 } | 3464 } |
| 3463 | 3465 |
| 3464 HInstruction concat(HInstruction left, HInstruction right) { | 3466 HInstruction concat(HInstruction left, HInstruction right) { |
| 3465 HInstruction instruction = new HStringConcat(left, right, diagnosticNode); | 3467 HInstruction instruction = new HStringConcat(left, right, diagnosticNode); |
| 3466 builder.add(instruction); | 3468 builder.add(instruction); |
| 3467 return instruction; | 3469 return instruction; |
| 3468 } | 3470 } |
| 3469 } | 3471 } |
| OLD | NEW |