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 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1489 isNotEquals = name.stringValue === '!='; | 1489 isNotEquals = name.stringValue === '!='; |
| 1490 dartMethodName = Elements.constructOperatorName( | 1490 dartMethodName = Elements.constructOperatorName( |
| 1491 const SourceString('operator'), | 1491 const SourceString('operator'), |
| 1492 name, | 1492 name, |
| 1493 node.argumentsNode is Prefix); | 1493 node.argumentsNode is Prefix); |
| 1494 } else { | 1494 } else { |
| 1495 dartMethodName = node.selector.asIdentifier().source; | 1495 dartMethodName = node.selector.asIdentifier().source; |
| 1496 } | 1496 } |
| 1497 | 1497 |
| 1498 Element interceptor = null; | 1498 Element interceptor = null; |
| 1499 if (methodInterceptionEnabled) { | 1499 if (methodInterceptionEnabled) { |
|
floitsch
2012/02/20 12:11:03
&& receiver !== null
This should be more correct
ahe
2012/02/20 12:33:22
Thank you, Florian. That makes sense. I assume you
floitsch
2012/02/20 12:56:51
correct.
| |
| 1500 interceptor = interceptors.getStaticInterceptor(dartMethodName, | 1500 interceptor = interceptors.getStaticInterceptor(dartMethodName, |
| 1501 node.argumentCount()); | 1501 node.argumentCount()); |
| 1502 } | 1502 } |
| 1503 if (interceptor != null) { | 1503 if (interceptor != null) { |
| 1504 HStatic target = new HStatic(interceptor); | 1504 HStatic target = new HStatic(interceptor); |
| 1505 add(target); | 1505 add(target); |
| 1506 inputs.add(target); | 1506 inputs.add(target); |
| 1507 visit(node.receiver); | 1507 if (node.receiver !== null) { |
| 1508 inputs.add(pop()); | 1508 visit(node.receiver); |
| 1509 inputs.add(pop()); | |
| 1510 } | |
| 1509 addGenericSendArgumentsToList(node.arguments, inputs); | 1511 addGenericSendArgumentsToList(node.arguments, inputs); |
| 1510 push(new HInvokeInterceptor(selector, dartMethodName, false, inputs)); | 1512 push(new HInvokeInterceptor(selector, dartMethodName, false, inputs)); |
| 1511 return; | 1513 return; |
| 1512 } | 1514 } |
| 1513 | 1515 |
| 1514 if (node.receiver === null) { | 1516 if (node.receiver === null) { |
| 1515 inputs.add(localsHandler.readThis()); | 1517 inputs.add(localsHandler.readThis()); |
| 1516 } else { | 1518 } else { |
| 1517 visit(node.receiver); | 1519 visit(node.receiver); |
| 1518 inputs.add(pop()); | 1520 inputs.add(pop()); |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2096 } | 2098 } |
| 2097 | 2099 |
| 2098 visitCatchBlock(CatchBlock node) { | 2100 visitCatchBlock(CatchBlock node) { |
| 2099 visit(node.block); | 2101 visit(node.block); |
| 2100 } | 2102 } |
| 2101 | 2103 |
| 2102 visitTypedef(Typedef node) { | 2104 visitTypedef(Typedef node) { |
| 2103 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); | 2105 compiler.unimplemented('SsaBuilder.visitTypedef', node: node); |
| 2104 } | 2106 } |
| 2105 } | 2107 } |
| OLD | NEW |