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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart

Issue 1296403004: dart2js cps: Do not treat final field reads as effectively constant. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library dart2js.ir_nodes; 4 library dart2js.ir_nodes;
5 5
6 import '../constants/values.dart' as values show ConstantValue; 6 import '../constants/values.dart' as values show ConstantValue;
7 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; 7 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType;
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../io/source_information.dart' show SourceInformation; 9 import '../io/source_information.dart' show SourceInformation;
10 import '../types/types.dart' show TypeMask; 10 import '../types/types.dart' show TypeMask;
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 // TODO(asgerf): This is a placeholder until we agree on how to track 704 // TODO(asgerf): This is a placeholder until we agree on how to track
705 // side effects. 705 // side effects.
706 bool objectIsNotNull = false; 706 bool objectIsNotNull = false;
707 707
708 GetField(Primitive object, this.field) 708 GetField(Primitive object, this.field)
709 : this.object = new Reference<Primitive>(object); 709 : this.object = new Reference<Primitive>(object);
710 710
711 accept(Visitor visitor) => visitor.visitGetField(this); 711 accept(Visitor visitor) => visitor.visitGetField(this);
712 712
713 bool get isSafeForElimination => objectIsNotNull; 713 bool get isSafeForElimination => objectIsNotNull;
714 bool get isSafeForReordering => objectIsNotNull && field.isFinal; 714 bool get isSafeForReordering => false;
715 } 715 }
716 716
717 /// Get the length of a string or native list. 717 /// Get the length of a string or native list.
718 class GetLength extends Primitive { 718 class GetLength extends Primitive {
719 final Reference<Primitive> object; 719 final Reference<Primitive> object;
720 720
721 /// True if the object is known not to be null. 721 /// True if the object is known not to be null.
722 bool objectIsNotNull = false; 722 bool objectIsNotNull = false;
723 723
724 GetLength(Primitive object) : this.object = new Reference<Primitive>(object); 724 GetLength(Primitive object) : this.object = new Reference<Primitive>(object);
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1625 /// Visit a just-deleted subterm and unlink all [Reference]s in it. 1625 /// Visit a just-deleted subterm and unlink all [Reference]s in it.
1626 class RemovalVisitor extends RecursiveVisitor { 1626 class RemovalVisitor extends RecursiveVisitor {
1627 processReference(Reference reference) { 1627 processReference(Reference reference) {
1628 reference.unlink(); 1628 reference.unlink();
1629 } 1629 }
1630 1630
1631 static void remove(Node node) { 1631 static void remove(Node node) {
1632 (new RemovalVisitor()).visit(node); 1632 (new RemovalVisitor()).visit(node);
1633 } 1633 }
1634 } 1634 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698