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

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

Issue 12385076: Infer types of catpured variables and use the types in the SSA builder. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 // TODO(sra): Refine the effect classification so that native effects are 612 // TODO(sra): Refine the effect classification so that native effects are
613 // distinct from ordinary Dart effects. 613 // distinct from ordinary Dart effects.
614 if (field.isNative()) { 614 if (field.isNative()) {
615 result.setDependsOnSomething(); 615 result.setDependsOnSomething();
616 } 616 }
617 617
618 if (field.getEnclosingClass().isNative()) { 618 if (field.getEnclosingClass().isNative()) {
619 result.instructionType = 619 result.instructionType =
620 new HType.subtype(field.computeType(compiler), compiler); 620 new HType.subtype(field.computeType(compiler), compiler);
621 } else { 621 } else {
622 HType type = new HType.inferredForElement(field, compiler); 622 HType type = new HType.inferredTypeForElement(field, compiler);
623 if (type.isUnknown()) { 623 if (type.isUnknown()) {
624 type = backend.optimisticFieldType(field); 624 type = backend.optimisticFieldType(field);
625 if (type != null) { 625 if (type != null) {
626 backend.registerFieldTypesOptimization( 626 backend.registerFieldTypesOptimization(
627 work.element, field, result.instructionType); 627 work.element, field, result.instructionType);
628 } 628 }
629 } 629 }
630 if (type != null) { 630 if (type != null) {
631 result.instructionType = type; 631 result.instructionType = type;
632 } 632 }
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
1539 HBasicBlock block = user.block; 1539 HBasicBlock block = user.block;
1540 block.addAfter(user, interceptor); 1540 block.addAfter(user, interceptor);
1541 block.rewrite(user, interceptor); 1541 block.rewrite(user, interceptor);
1542 block.remove(user); 1542 block.remove(user);
1543 1543
1544 // The interceptor will be removed in the dead code elimination 1544 // The interceptor will be removed in the dead code elimination
1545 // phase. Note that removing it here would not work because of how 1545 // phase. Note that removing it here would not work because of how
1546 // the [visitBasicBlock] is implemented. 1546 // the [visitBasicBlock] is implemented.
1547 } 1547 }
1548 } 1548 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698