Chromium Code Reviews| 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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1717 enableMethodInterception(); | 1717 enableMethodInterception(); |
| 1718 break; | 1718 break; |
| 1719 case "JS_HAS_EQUALS": | 1719 case "JS_HAS_EQUALS": |
| 1720 List<HInstruction> inputs = <HInstruction>[]; | 1720 List<HInstruction> inputs = <HInstruction>[]; |
| 1721 if (!node.arguments.tail.isEmpty()) { | 1721 if (!node.arguments.tail.isEmpty()) { |
| 1722 compiler.cancel('More than one expression in JS_HAS_EQUALS()'); | 1722 compiler.cancel('More than one expression in JS_HAS_EQUALS()'); |
| 1723 } | 1723 } |
| 1724 addGenericSendArgumentsToList(node.arguments, inputs); | 1724 addGenericSendArgumentsToList(node.arguments, inputs); |
| 1725 String name = compiler.namer.instanceMethodName( | 1725 String name = compiler.namer.instanceMethodName( |
| 1726 Namer.OPERATOR_EQUALS, 1); | 1726 Namer.OPERATOR_EQUALS, 1); |
| 1727 push(new HForeign(new DartString.literal('#.$name'), | 1727 push(new HForeign(new DartString.literal('!!#.$name'), |
|
ngeoffray
2012/03/15 12:15:39
In case we don't propagate types, the check will r
| |
| 1728 const LiteralDartString('bool'), | 1728 const LiteralDartString('bool'), |
| 1729 inputs)); | 1729 inputs)); |
| 1730 break; | 1730 break; |
| 1731 case "native": | 1731 case "native": |
| 1732 native.handleSsaNative(this, node); | 1732 native.handleSsaNative(this, node); |
| 1733 break; | 1733 break; |
| 1734 default: | 1734 default: |
| 1735 throw "Unknown foreign: ${node.selector}"; | 1735 throw "Unknown foreign: ${node.selector}"; |
| 1736 } | 1736 } |
| 1737 } | 1737 } |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2520 buildBody() { | 2520 buildBody() { |
| 2521 // TODO(lrn): Make sure to take continue into account. | 2521 // TODO(lrn): Make sure to take continue into account. |
| 2522 visit(body); | 2522 visit(body); |
| 2523 if (isAborted()) { | 2523 if (isAborted()) { |
| 2524 compiler.reportWarning(body, "aborting loop body"); | 2524 compiler.reportWarning(body, "aborting loop body"); |
| 2525 } | 2525 } |
| 2526 } | 2526 } |
| 2527 handleIf(buildBody, null); | 2527 handleIf(buildBody, null); |
| 2528 } | 2528 } |
| 2529 } | 2529 } |
| OLD | NEW |