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

Side by Side Diff: lib/compiler/implementation/ssa/nodes.dart

Issue 11031068: Do not GVN HLocalGet. If the local is final, the GVN thinks it can loop hoist accesses to it (which… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « no previous file | tests/language/final_used_in_try_test.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) 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 abstract class HVisitor<R> { 5 abstract class HVisitor<R> {
6 R visitAdd(HAdd node); 6 R visitAdd(HAdd node);
7 R visitBailoutTarget(HBailoutTarget node); 7 R visitBailoutTarget(HBailoutTarget node);
8 R visitBitAnd(HBitAnd node); 8 R visitBitAnd(HBitAnd node);
9 R visitBitNot(HBitNot node); 9 R visitBitNot(HBitNot node);
10 R visitBitOr(HBitOr node); 10 R visitBitOr(HBitOr node);
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1550 bool isJsStatement(HTypeMap types) => true; 1550 bool isJsStatement(HTypeMap types) => true;
1551 String toString() => "FieldSet $element"; 1551 String toString() => "FieldSet $element";
1552 } 1552 }
1553 1553
1554 class HLocalGet extends HFieldGet { 1554 class HLocalGet extends HFieldGet {
1555 HLocalGet(Element element, HLocalValue local) : super(element, local); 1555 HLocalGet(Element element, HLocalValue local) : super(element, local);
1556 1556
1557 accept(HVisitor visitor) => visitor.visitLocalGet(this); 1557 accept(HVisitor visitor) => visitor.visitLocalGet(this);
1558 1558
1559 HLocalValue get local => inputs[0]; 1559 HLocalValue get local => inputs[0];
1560
1561 void prepareGvn(HTypeMap types) {
1562 // No need to use GVN for a [HLocalGet], it is just a local
1563 // access.
1564 clearAllSideEffects();
1565 }
1560 } 1566 }
1561 1567
1562 class HLocalSet extends HFieldSet { 1568 class HLocalSet extends HFieldSet {
1563 HLocalSet(Element element, HLocalValue local, HInstruction value) 1569 HLocalSet(Element element, HLocalValue local, HInstruction value)
1564 : super(element, local, value); 1570 : super(element, local, value);
1565 1571
1566 accept(HVisitor visitor) => visitor.visitLocalSet(this); 1572 accept(HVisitor visitor) => visitor.visitLocalSet(this);
1567 1573
1568 HLocalValue get local => inputs[0]; 1574 HLocalValue get local => inputs[0];
1569 } 1575 }
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
2972 HBasicBlock get start => expression.start; 2978 HBasicBlock get start => expression.start;
2973 HBasicBlock get end { 2979 HBasicBlock get end {
2974 // We don't create a switch block if there are no cases. 2980 // We don't create a switch block if there are no cases.
2975 assert(!statements.isEmpty()); 2981 assert(!statements.isEmpty());
2976 return statements.last().end; 2982 return statements.last().end;
2977 } 2983 }
2978 2984
2979 bool accept(HStatementInformationVisitor visitor) => 2985 bool accept(HStatementInformationVisitor visitor) =>
2980 visitor.visitSwitchInfo(this); 2986 visitor.visitSwitchInfo(this);
2981 } 2987 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/final_used_in_try_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698