| OLD | NEW |
| 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 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 bool contains(HInstruction instruction) { | 391 bool contains(HInstruction instruction) { |
| 392 HInstruction cursor = first; | 392 HInstruction cursor = first; |
| 393 while (cursor != null) { | 393 while (cursor != null) { |
| 394 if (cursor === instruction) return true; | 394 if (cursor === instruction) return true; |
| 395 cursor = cursor.next; | 395 cursor = cursor.next; |
| 396 } | 396 } |
| 397 return false; | 397 return false; |
| 398 } | 398 } |
| 399 } | 399 } |
| 400 | 400 |
| 401 class HBasicBlock extends HInstructionList { | 401 class HBasicBlock extends HInstructionList implements Hashable { |
| 402 // The [id] must be such that any successor's id is greater than | 402 // The [id] must be such that any successor's id is greater than |
| 403 // this [id]. The exception are back-edges. | 403 // this [id]. The exception are back-edges. |
| 404 int id; | 404 int id; |
| 405 | 405 |
| 406 static final int STATUS_NEW = 0; | 406 static final int STATUS_NEW = 0; |
| 407 static final int STATUS_OPEN = 1; | 407 static final int STATUS_OPEN = 1; |
| 408 static final int STATUS_CLOSED = 2; | 408 static final int STATUS_CLOSED = 2; |
| 409 int status = STATUS_NEW; | 409 int status = STATUS_NEW; |
| 410 | 410 |
| 411 HInstructionList phis; | 411 HInstructionList phis; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 425 List<SourceString> labels; | 425 List<SourceString> labels; |
| 426 | 426 |
| 427 HBasicBlock() : this.withId(null); | 427 HBasicBlock() : this.withId(null); |
| 428 HBasicBlock.withId(this.id) | 428 HBasicBlock.withId(this.id) |
| 429 : phis = new HInstructionList(), | 429 : phis = new HInstructionList(), |
| 430 predecessors = <HBasicBlock>[], | 430 predecessors = <HBasicBlock>[], |
| 431 successors = const <HBasicBlock>[], | 431 successors = const <HBasicBlock>[], |
| 432 dominatedBlocks = <HBasicBlock>[], | 432 dominatedBlocks = <HBasicBlock>[], |
| 433 bailouts = <HBailoutTarget>[]; | 433 bailouts = <HBailoutTarget>[]; |
| 434 | 434 |
| 435 int hashCode() => id; |
| 436 |
| 435 bool isNew() => status == STATUS_NEW; | 437 bool isNew() => status == STATUS_NEW; |
| 436 bool isOpen() => status == STATUS_OPEN; | 438 bool isOpen() => status == STATUS_OPEN; |
| 437 bool isClosed() => status == STATUS_CLOSED; | 439 bool isClosed() => status == STATUS_CLOSED; |
| 438 | 440 |
| 439 bool isLoopHeader() => loopInformation !== null; | 441 bool isLoopHeader() => loopInformation !== null; |
| 440 bool hasLabeledBlockInformation() => labeledBlockInformation !== null; | 442 bool hasLabeledBlockInformation() => labeledBlockInformation !== null; |
| 441 | 443 |
| 442 bool hasBailouts() => !bailouts.isEmpty(); | 444 bool hasBailouts() => !bailouts.isEmpty(); |
| 443 | 445 |
| 444 void open() { | 446 void open() { |
| (...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 class HIfBlockInformation { | 2122 class HIfBlockInformation { |
| 2121 final HIf branch; | 2123 final HIf branch; |
| 2122 final SubGraph thenGraph; | 2124 final SubGraph thenGraph; |
| 2123 final SubGraph elseGraph; | 2125 final SubGraph elseGraph; |
| 2124 final HBasicBlock joinBlock; | 2126 final HBasicBlock joinBlock; |
| 2125 HIfBlockInformation(this.branch, | 2127 HIfBlockInformation(this.branch, |
| 2126 this.thenGraph, | 2128 this.thenGraph, |
| 2127 this.elseGraph, | 2129 this.elseGraph, |
| 2128 this.joinBlock); | 2130 this.joinBlock); |
| 2129 } | 2131 } |
| OLD | NEW |