| OLD | NEW |
| 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 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 582 |
| 583 void addSuccessor(HBasicBlock block) { | 583 void addSuccessor(HBasicBlock block) { |
| 584 if (successors.isEmpty()) { | 584 if (successors.isEmpty()) { |
| 585 successors = [block]; | 585 successors = [block]; |
| 586 } else { | 586 } else { |
| 587 successors.add(block); | 587 successors.add(block); |
| 588 } | 588 } |
| 589 block.predecessors.add(this); | 589 block.predecessors.add(this); |
| 590 } | 590 } |
| 591 | 591 |
| 592 void removeSuccessor(HBasicBlock successor) { | |
| 593 successors.removeAt(successors.indexOf(successor)); | |
| 594 successor.predecessors.removeAt(successors.predecessors.indexOf(this)); | |
| 595 } | |
| 596 | |
| 597 void postProcessLoopHeader() { | 592 void postProcessLoopHeader() { |
| 598 assert(isLoopHeader()); | 593 assert(isLoopHeader()); |
| 599 // Only the first entry into the loop is from outside the | 594 // Only the first entry into the loop is from outside the |
| 600 // loop. All other entries must be back edges. | 595 // loop. All other entries must be back edges. |
| 601 for (int i = 1, length = predecessors.length; i < length; i++) { | 596 for (int i = 1, length = predecessors.length; i < length; i++) { |
| 602 loopInformation.addBackEdge(predecessors[i]); | 597 loopInformation.addBackEdge(predecessors[i]); |
| 603 } | 598 } |
| 604 } | 599 } |
| 605 | 600 |
| 606 /** | 601 /** |
| (...skipping 2372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2979 HBasicBlock get start => expression.start; | 2974 HBasicBlock get start => expression.start; |
| 2980 HBasicBlock get end { | 2975 HBasicBlock get end { |
| 2981 // We don't create a switch block if there are no cases. | 2976 // We don't create a switch block if there are no cases. |
| 2982 assert(!statements.isEmpty()); | 2977 assert(!statements.isEmpty()); |
| 2983 return statements.last().end; | 2978 return statements.last().end; |
| 2984 } | 2979 } |
| 2985 | 2980 |
| 2986 bool accept(HStatementInformationVisitor visitor) => | 2981 bool accept(HStatementInformationVisitor visitor) => |
| 2987 visitor.visitSwitchInfo(this); | 2982 visitor.visitSwitchInfo(this); |
| 2988 } | 2983 } |
| OLD | NEW |