Chromium Code Reviews| Index: lib/compiler/implementation/ssa/optimize.dart |
| diff --git a/lib/compiler/implementation/ssa/optimize.dart b/lib/compiler/implementation/ssa/optimize.dart |
| index e3135c9ac09676d2f88dc5bec684ffed056905de..62b1a7b4c79f6fabde64d3d8fa41be396bcc068c 100644 |
| --- a/lib/compiler/implementation/ssa/optimize.dart |
| +++ b/lib/compiler/implementation/ssa/optimize.dart |
| @@ -206,11 +206,11 @@ class SsaConstantFolder extends HBaseVisitor implements OptimizationPhase { |
| } |
| if (input.isString(types) |
| - && node.name == const SourceString('toString')) { |
| + && node.selector.name == const SourceString('toString')) { |
| return node.inputs[1]; |
| } |
| - if (!input.canBePrimitive(types) && !node.getter && !node.setter) { |
| + if (!input.canBePrimitive(types) && node.selector.isCall()) { |
| bool transformToDynamicInvocation = true; |
| if (input.canBeNull(types)) { |
| // Check if the method exists on Null. If yes we must not transform |
| @@ -664,15 +664,11 @@ class SsaCheckInserter extends HBaseVisitor implements OptimizationPhase { |
| HInstruction index) { |
| HStatic interceptor = new HStatic(lengthInterceptor); |
| node.block.addBefore(node, interceptor); |
| - Selector selector = new Selector.call( |
| - lengthInterceptor.name, |
| - lengthInterceptor.getLibrary(), // TODO(kasperl): Wrong. |
| - 0); |
| + Selector selector = new Selector.getter( |
| + const SourceString('length'), |
| + lengthInterceptor.getLibrary()); // TODO(kasperl): Wrong. |
|
ngeoffray
2012/08/22 13:58:54
Actually, I think the instruction to create should
|
| HInvokeInterceptor length = new HInvokeInterceptor( |
| - selector, |
| - const SourceString("length"), |
| - <HInstruction>[interceptor, receiver], |
| - getter: true); |
| + selector, <HInstruction>[interceptor, receiver]); |
| types[length] = HType.INTEGER; |
| node.block.addBefore(node, length); |