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 29 matching lines...) Expand all Loading... |
40 if (name === '^=') return const SourceString('xor'); | 40 if (name === '^=') return const SourceString('xor'); |
41 if (name === '++') return const SourceString('add'); | 41 if (name === '++') return const SourceString('add'); |
42 if (name === '--') return const SourceString('sub'); | 42 if (name === '--') return const SourceString('sub'); |
43 compiler.unimplemented('Unknown operator', node: op); | 43 compiler.unimplemented('Unknown operator', node: op); |
44 } | 44 } |
45 | 45 |
46 // TODO(karlklose,kasperl): change uses of getStatic[Get|Set]Interceptor to | 46 // TODO(karlklose,kasperl): change uses of getStatic[Get|Set]Interceptor to |
47 // use this function. | 47 // use this function. |
48 Element getStaticInterceptorBySelector(Selector selector) { | 48 Element getStaticInterceptorBySelector(Selector selector) { |
49 if (selector.isGetter()) { | 49 if (selector.isGetter()) { |
| 50 // TODO(lrn): If there is no get-interceptor, but there is a |
| 51 // method-interceptor, we should generate a get-interceptor automatically. |
50 return getStaticGetInterceptor(selector.name); | 52 return getStaticGetInterceptor(selector.name); |
51 } else if (selector.isSetter()) { | 53 } else if (selector.isSetter()) { |
52 return getStaticSetInterceptor(selector.name); | 54 return getStaticSetInterceptor(selector.name); |
53 } else { | 55 } else { |
54 return getStaticInterceptor(selector.name, selector.argumentCount); | 56 return getStaticInterceptor(selector.name, selector.argumentCount); |
55 } | 57 } |
56 } | 58 } |
57 | 59 |
58 Element getStaticInterceptor(SourceString name, int parameters) { | 60 Element getStaticInterceptor(SourceString name, int parameters) { |
59 String mangledName = name.slowToString(); | 61 String mangledName = name.slowToString(); |
(...skipping 4287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4347 new HSubGraphBlockInformation(elseBranch.graph)); | 4349 new HSubGraphBlockInformation(elseBranch.graph)); |
4348 | 4350 |
4349 HBasicBlock conditionStartBlock = conditionBranch.block; | 4351 HBasicBlock conditionStartBlock = conditionBranch.block; |
4350 conditionStartBlock.setBlockFlow(info, joinBlock); | 4352 conditionStartBlock.setBlockFlow(info, joinBlock); |
4351 SubGraph conditionGraph = conditionBranch.graph; | 4353 SubGraph conditionGraph = conditionBranch.graph; |
4352 HIf branch = conditionGraph.end.last; | 4354 HIf branch = conditionGraph.end.last; |
4353 assert(branch is HIf); | 4355 assert(branch is HIf); |
4354 branch.blockInformation = conditionStartBlock.blockFlow; | 4356 branch.blockInformation = conditionStartBlock.blockFlow; |
4355 } | 4357 } |
4356 } | 4358 } |
OLD | NEW |