| 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 part of ssa; | 5 part of ssa; | 
| 6 | 6 | 
| 7 abstract class OptimizationPhase { | 7 abstract class OptimizationPhase { | 
| 8   String get name; | 8   String get name; | 
| 9   void visitGraph(HGraph graph); | 9   void visitGraph(HGraph graph); | 
| 10 } | 10 } | 
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 303       if (target != null) { | 303       if (target != null) { | 
| 304         // TODO(ngeoffray): There is a strong dependency between codegen | 304         // TODO(ngeoffray): There is a strong dependency between codegen | 
| 305         // and this optimization that the dynamic invoke does not need an | 305         // and this optimization that the dynamic invoke does not need an | 
| 306         // interceptor. We currently need to keep a | 306         // interceptor. We currently need to keep a | 
| 307         // HInvokeDynamicMethod and not create a HForeign because | 307         // HInvokeDynamicMethod and not create a HForeign because | 
| 308         // HForeign is too opaque for the SsaCheckInserter (that adds a | 308         // HForeign is too opaque for the SsaCheckInserter (that adds a | 
| 309         // bounds check on removeLast). Once we start inlining, the | 309         // bounds check on removeLast). Once we start inlining, the | 
| 310         // bounds check will become explicit, so we won't need this | 310         // bounds check will become explicit, so we won't need this | 
| 311         // optimization. | 311         // optimization. | 
| 312         HInvokeDynamicMethod result = new HInvokeDynamicMethod( | 312         HInvokeDynamicMethod result = new HInvokeDynamicMethod( | 
| 313             node.selector, node.inputs.getRange(1, node.inputs.length - 1)); | 313             node.selector, node.inputs.sublist(1)); | 
| 314         result.element = target; | 314         result.element = target; | 
| 315         return result; | 315         return result; | 
| 316       } | 316       } | 
| 317     } else if (selector.isGetter()) { | 317     } else if (selector.isGetter()) { | 
| 318       if (selector.applies(backend.jsArrayLength, compiler)) { | 318       if (selector.applies(backend.jsArrayLength, compiler)) { | 
| 319         HInstruction optimized = tryOptimizeLengthInterceptedGetter(node); | 319         HInstruction optimized = tryOptimizeLengthInterceptedGetter(node); | 
| 320         if (optimized != null) return optimized; | 320         if (optimized != null) return optimized; | 
| 321       } | 321       } | 
| 322     } | 322     } | 
| 323 | 323 | 
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1532     HBasicBlock block = user.block; | 1532     HBasicBlock block = user.block; | 
| 1533     block.addAfter(user, interceptor); | 1533     block.addAfter(user, interceptor); | 
| 1534     block.rewrite(user, interceptor); | 1534     block.rewrite(user, interceptor); | 
| 1535     block.remove(user); | 1535     block.remove(user); | 
| 1536 | 1536 | 
| 1537     // The interceptor will be removed in the dead code elimination | 1537     // The interceptor will be removed in the dead code elimination | 
| 1538     // phase. Note that removing it here would not work because of how | 1538     // phase. Note that removing it here would not work because of how | 
| 1539     // the [visitBasicBlock] is implemented. | 1539     // the [visitBasicBlock] is implemented. | 
| 1540   } | 1540   } | 
| 1541 } | 1541 } | 
| OLD | NEW | 
|---|