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

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

Issue 10810043: Reenable GVN for fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | lib/compiler/implementation/ssa/optimize.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 interface HVisitor<R> { 5 interface HVisitor<R> {
6 R visitAdd(HAdd node); 6 R visitAdd(HAdd node);
7 R visitBitAnd(HBitAnd node); 7 R visitBitAnd(HBitAnd node);
8 R visitBitNot(HBitNot node); 8 R visitBitNot(HBitNot node);
9 R visitBitOr(HBitOr node); 9 R visitBitOr(HBitOr node);
10 R visitBitXor(HBitXor node); 10 R visitBitXor(HBitXor node);
(...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 if (name == const SourceString('add') 1265 if (name == const SourceString('add')
1266 || name == const SourceString('removeLast')) { 1266 || name == const SourceString('removeLast')) {
1267 return HType.MUTABLE_ARRAY; 1267 return HType.MUTABLE_ARRAY;
1268 } 1268 }
1269 } 1269 }
1270 return HType.UNKNOWN; 1270 return HType.UNKNOWN;
1271 } 1271 }
1272 1272
1273 void prepareGvn() { 1273 void prepareGvn() {
1274 if (isLengthGetterOnStringOrArray()) { 1274 if (isLengthGetterOnStringOrArray()) {
1275 setUseGvn();
1275 clearAllSideEffects(); 1276 clearAllSideEffects();
1277 setDependsOnSomething();
1276 } else { 1278 } else {
1277 setAllSideEffects(); 1279 setAllSideEffects();
1278 } 1280 }
1279 } 1281 }
1280 1282
1281 int typeCode() => 4; 1283 int typeCode() => 4;
1282 bool typeEquals(other) => other is HInvokeInterceptor; 1284 bool typeEquals(other) => other is HInvokeInterceptor;
1283 bool dataEquals(HInvokeInterceptor other) { 1285 bool dataEquals(HInvokeInterceptor other) {
1284 return getter == other.getter && name == other.name; 1286 return getter == other.getter && name == other.name;
1285 } 1287 }
(...skipping 10 matching lines...) Expand all
1296 1298
1297 HFieldGet(Element element, HInstruction receiver, 1299 HFieldGet(Element element, HInstruction receiver,
1298 [this.isFinalOrConst = false]) 1300 [this.isFinalOrConst = false])
1299 : super(element, <HInstruction>[receiver]); 1301 : super(element, <HInstruction>[receiver]);
1300 1302
1301 HInstruction get receiver() => inputs[0]; 1303 HInstruction get receiver() => inputs[0];
1302 1304
1303 accept(HVisitor visitor) => visitor.visitFieldGet(this); 1305 accept(HVisitor visitor) => visitor.visitFieldGet(this);
1304 1306
1305 void prepareGvn() { 1307 void prepareGvn() {
1308 setUseGvn();
1306 clearAllSideEffects(); 1309 clearAllSideEffects();
floitsch 2012/07/20 18:25:20 The original version (when GVN was enabled) did no
1310 if (!isFinalOrConst) setDependsOnSomething();
1307 } 1311 }
1308 1312
1309 int typeCode() => 27; 1313 int typeCode() => 27;
1310 bool typeEquals(other) => other is HFieldGet; 1314 bool typeEquals(other) => other is HFieldGet;
1311 bool dataEquals(HFieldGet other) => element == other.element; 1315 bool dataEquals(HFieldGet other) => element == other.element;
1312 String toString() => "FieldGet $element"; 1316 String toString() => "FieldGet $element";
1313 } 1317 }
1314 1318
1315 class HFieldSet extends HFieldAccess { 1319 class HFieldSet extends HFieldAccess {
1316 HFieldSet(Element element, HInstruction receiver, HInstruction value) 1320 HFieldSet(Element element, HInstruction receiver, HInstruction value)
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 HBasicBlock get start() => expression.start; 2662 HBasicBlock get start() => expression.start;
2659 HBasicBlock get end() { 2663 HBasicBlock get end() {
2660 // We don't create a switch block if there are no cases. 2664 // We don't create a switch block if there are no cases.
2661 assert(!statements.isEmpty()); 2665 assert(!statements.isEmpty());
2662 return statements.last().end; 2666 return statements.last().end;
2663 } 2667 }
2664 2668
2665 bool accept(HStatementInformationVisitor visitor) => 2669 bool accept(HStatementInformationVisitor visitor) =>
2666 visitor.visitSwitchInfo(this); 2670 visitor.visitSwitchInfo(this);
2667 } 2671 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/optimize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698