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

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

Issue 19347002: Fix crash https://code.google.com/p/dart/issues/detail?id=11793: only compute a range for a loop if… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.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 part of ssa; 5 part of ssa;
6 6
7 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitBailoutTarget(HBailoutTarget node); 9 R visitBailoutTarget(HBailoutTarget node);
10 R visitBitAnd(HBitAnd node); 10 R visitBitAnd(HBitAnd node);
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 to.usedBy.addAll(from.usedBy); 613 to.usedBy.addAll(from.usedBy);
614 from.usedBy.clear(); 614 from.usedBy.clear();
615 } 615 }
616 616
617 /** 617 /**
618 * Rewrites all uses of the [from] instruction to using either the 618 * Rewrites all uses of the [from] instruction to using either the
619 * [to] instruction, or a [HCheck] instruction that has better type 619 * [to] instruction, or a [HCheck] instruction that has better type
620 * information on [to], and that dominates the user. 620 * information on [to], and that dominates the user.
621 */ 621 */
622 void rewriteWithBetterUser(HInstruction from, HInstruction to) { 622 void rewriteWithBetterUser(HInstruction from, HInstruction to) {
623 // BUG(11841): Turn this method into a phase to be run after GVN phases.
623 Link<HCheck> better = const Link<HCheck>(); 624 Link<HCheck> better = const Link<HCheck>();
624 for (HInstruction user in to.usedBy) { 625 for (HInstruction user in to.usedBy) {
625 if (user == from || user is! HCheck) continue; 626 if (user == from || user is! HCheck) continue;
626 HCheck check = user; 627 HCheck check = user;
627 if (check.checkedInput == to) { 628 if (check.checkedInput == to) {
628 better = better.prepend(user); 629 better = better.prepend(user);
629 } 630 }
630 } 631 }
631 632
632 if (better.isEmpty) return rewrite(from, to); 633 if (better.isEmpty) return rewrite(from, to);
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after
2712 HBasicBlock get start => expression.start; 2713 HBasicBlock get start => expression.start;
2713 HBasicBlock get end { 2714 HBasicBlock get end {
2714 // We don't create a switch block if there are no cases. 2715 // We don't create a switch block if there are no cases.
2715 assert(!statements.isEmpty); 2716 assert(!statements.isEmpty);
2716 return statements.last.end; 2717 return statements.last.end;
2717 } 2718 }
2718 2719
2719 bool accept(HStatementInformationVisitor visitor) => 2720 bool accept(HStatementInformationVisitor visitor) =>
2720 visitor.visitSwitchInfo(this); 2721 visitor.visitSwitchInfo(this);
2721 } 2722 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698