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

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

Issue 10801008: Disable GVN for interceptors and 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 | tests/language/gvn_field_access_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 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 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 if (name == const SourceString('add') 1264 if (name == const SourceString('add')
1265 || name == const SourceString('removeLast')) { 1265 || name == const SourceString('removeLast')) {
1266 return HType.MUTABLE_ARRAY; 1266 return HType.MUTABLE_ARRAY;
1267 } 1267 }
1268 } 1268 }
1269 return HType.UNKNOWN; 1269 return HType.UNKNOWN;
1270 } 1270 }
1271 1271
1272 void prepareGvn() { 1272 void prepareGvn() {
1273 if (isLengthGetterOnStringOrArray()) { 1273 if (isLengthGetterOnStringOrArray()) {
1274 setUseGvn();
1275 clearAllSideEffects(); 1274 clearAllSideEffects();
1276 setDependsOnSomething();
1277 } else { 1275 } else {
1278 setAllSideEffects(); 1276 setAllSideEffects();
1279 } 1277 }
1280 } 1278 }
1281 1279
1282 int typeCode() => 4; 1280 int typeCode() => 4;
1283 bool typeEquals(other) => other is HInvokeInterceptor; 1281 bool typeEquals(other) => other is HInvokeInterceptor;
1284 bool dataEquals(HInvokeInterceptor other) { 1282 bool dataEquals(HInvokeInterceptor other) {
1285 return getter == other.getter && name == other.name; 1283 return getter == other.getter && name == other.name;
1286 } 1284 }
(...skipping 10 matching lines...) Expand all
1297 1295
1298 HFieldGet(Element element, HInstruction receiver, 1296 HFieldGet(Element element, HInstruction receiver,
1299 [this.isFinalOrConst = false]) 1297 [this.isFinalOrConst = false])
1300 : super(element, <HInstruction>[receiver]); 1298 : super(element, <HInstruction>[receiver]);
1301 1299
1302 HInstruction get receiver() => inputs[0]; 1300 HInstruction get receiver() => inputs[0];
1303 1301
1304 accept(HVisitor visitor) => visitor.visitFieldGet(this); 1302 accept(HVisitor visitor) => visitor.visitFieldGet(this);
1305 1303
1306 void prepareGvn() { 1304 void prepareGvn() {
1307 setUseGvn(); 1305 clearAllSideEffects();
1308 if (!isFinalOrConst) setDependsOnSomething();
1309 } 1306 }
1310 1307
1311 int typeCode() => 27; 1308 int typeCode() => 27;
1312 bool typeEquals(other) => other is HFieldGet; 1309 bool typeEquals(other) => other is HFieldGet;
1313 bool dataEquals(HFieldGet other) => element == other.element; 1310 bool dataEquals(HFieldGet other) => element == other.element;
1314 String toString() => "FieldGet $element"; 1311 String toString() => "FieldGet $element";
1315 } 1312 }
1316 1313
1317 class HFieldSet extends HFieldAccess { 1314 class HFieldSet extends HFieldAccess {
1318 HFieldSet(Element element, HInstruction receiver, HInstruction value) 1315 HFieldSet(Element element, HInstruction receiver, HInstruction value)
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2660 HBasicBlock get start() => expression.start; 2657 HBasicBlock get start() => expression.start;
2661 HBasicBlock get end() { 2658 HBasicBlock get end() {
2662 // We don't create a switch block if there are no cases. 2659 // We don't create a switch block if there are no cases.
2663 assert(!statements.isEmpty()); 2660 assert(!statements.isEmpty());
2664 return statements.last().end; 2661 return statements.last().end;
2665 } 2662 }
2666 2663
2667 bool accept(HStatementInformationVisitor visitor) => 2664 bool accept(HStatementInformationVisitor visitor) =>
2668 visitor.visitSwitchInfo(this); 2665 visitor.visitSwitchInfo(this);
2669 } 2666 }
OLDNEW
« no previous file with comments | « no previous file | tests/language/gvn_field_access_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698