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

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

Issue 10165004: Only emit typeguards if we think they are valuable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 8 years, 8 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 438
439 int hashCode() => id; 439 int hashCode() => id;
440 440
441 bool isNew() => status == STATUS_NEW; 441 bool isNew() => status == STATUS_NEW;
442 bool isOpen() => status == STATUS_OPEN; 442 bool isOpen() => status == STATUS_OPEN;
443 bool isClosed() => status == STATUS_CLOSED; 443 bool isClosed() => status == STATUS_CLOSED;
444 444
445 bool isLoopHeader() => blockInformation is HLoopInformation; 445 bool isLoopHeader() => blockInformation is HLoopInformation;
446 bool isLabeledBlock() => blockInformation is HLabeledBlockInformation; 446 bool isLabeledBlock() => blockInformation is HLabeledBlockInformation;
447 447
448 HBasicBlock get enclosingLoopHeader() {
449 if (isLoopHeader()) return this;
450 return parentLoopHeader;
451 }
452
448 bool hasGuards() => !guards.isEmpty(); 453 bool hasGuards() => !guards.isEmpty();
449 454
450 void open() { 455 void open() {
451 assert(isNew()); 456 assert(isNew());
452 status = STATUS_OPEN; 457 status = STATUS_OPEN;
453 } 458 }
454 459
455 void close(HControlFlow end) { 460 void close(HControlFlow end) {
456 assert(isOpen()); 461 assert(isOpen());
457 addAfter(last, end); 462 addAfter(last, end);
(...skipping 1841 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 final bool isAnd; 2304 final bool isAnd;
2300 final SubExpression left; 2305 final SubExpression left;
2301 final SubExpression right; 2306 final SubExpression right;
2302 final HBasicBlock joinBlock; 2307 final HBasicBlock joinBlock;
2303 HAndOrBlockInformation(this.isAnd, 2308 HAndOrBlockInformation(this.isAnd,
2304 this.left, 2309 this.left,
2305 this.right, 2310 this.right,
2306 this.joinBlock); 2311 this.joinBlock);
2307 bool accept(HBlockInformationVisitor visitor) => visitor.visitAndOrInfo(this); 2312 bool accept(HBlockInformationVisitor visitor) => visitor.visitAndOrInfo(this);
2308 } 2313 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/bailout.dart ('k') | tests/language/src/ListDoubleIndexInLoop2Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698