Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 HBasicBlock block = user.block; 1531 HBasicBlock block = user.block;
1532 block.addAfter(user, interceptor); 1532 block.addAfter(user, interceptor);
1533 block.rewrite(user, interceptor); 1533 block.rewrite(user, interceptor);
1534 block.remove(user); 1534 block.remove(user);
1535 1535
1536 // The interceptor will be removed in the dead code elimination 1536 // The interceptor will be removed in the dead code elimination
1537 // phase. Note that removing it here would not work because of how 1537 // phase. Note that removing it here would not work because of how
1538 // the [visitBasicBlock] is implemented. 1538 // the [visitBasicBlock] is implemented.
1539 } 1539 }
1540 } 1540 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698