Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/ir/BlockBegin.java @ 2602:0c6564c254af
new node layout: BlockBegin, BlockEnd
-Dc1x.dot=regex for pdf output
escape dot graph labels (<, >, &)
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Fri, 06 May 2011 10:25:37 +0200 |
parents | 768d77a1c7af |
children | 01c5c0443158 |
comparison
equal
deleted
inserted
replaced
2601:224e8b4007bd | 2602:0c6564c254af |
---|---|
22 */ | 22 */ |
23 package com.sun.c1x.ir; | 23 package com.sun.c1x.ir; |
24 | 24 |
25 import java.util.*; | 25 import java.util.*; |
26 | 26 |
27 import com.oracle.graal.graph.*; | |
27 import com.sun.c1x.*; | 28 import com.sun.c1x.*; |
28 import com.sun.c1x.asm.*; | 29 import com.sun.c1x.asm.*; |
29 import com.sun.c1x.debug.*; | 30 import com.sun.c1x.debug.*; |
30 import com.sun.c1x.lir.*; | 31 import com.sun.c1x.lir.*; |
31 import com.sun.c1x.util.*; | 32 import com.sun.c1x.util.*; |
35 | 36 |
36 /** | 37 /** |
37 * Denotes the beginning of a basic block, and holds information | 38 * Denotes the beginning of a basic block, and holds information |
38 * about the basic block, including the successor and | 39 * about the basic block, including the successor and |
39 * predecessor blocks, exception handlers, liveness information, etc. | 40 * predecessor blocks, exception handlers, liveness information, etc. |
40 * | |
41 * @author Ben L. Titzer | |
42 */ | 41 */ |
43 public final class BlockBegin extends Instruction { | 42 public final class BlockBegin extends Instruction { |
43 | |
44 private static final int INPUT_COUNT = 0; | |
45 private static final int SUCCESSOR_COUNT = 0; | |
46 | |
44 private static final List<BlockBegin> NO_HANDLERS = Collections.emptyList(); | 47 private static final List<BlockBegin> NO_HANDLERS = Collections.emptyList(); |
45 | 48 |
46 /** | 49 /** |
47 * An enumeration of flags for block entries indicating various things. | 50 * An enumeration of flags for block entries indicating various things. |
48 */ | 51 */ |
101 | 104 |
102 /** | 105 /** |
103 * Constructs a new BlockBegin at the specified bytecode index. | 106 * Constructs a new BlockBegin at the specified bytecode index. |
104 * @param bci the bytecode index of the start | 107 * @param bci the bytecode index of the start |
105 * @param blockID the ID of the block | 108 * @param blockID the ID of the block |
106 */ | 109 * @param graph |
107 public BlockBegin(int bci, int blockID) { | 110 */ |
108 super(CiKind.Illegal); | 111 public BlockBegin(int bci, int blockID, Graph graph) { |
112 super(CiKind.Illegal, INPUT_COUNT, SUCCESSOR_COUNT, graph); | |
109 this.blockID = blockID; | 113 this.blockID = blockID; |
110 depthFirstNumber = -1; | 114 depthFirstNumber = -1; |
111 linearScanNumber = -1; | 115 linearScanNumber = -1; |
112 predecessors = new ArrayList<BlockBegin>(2); | 116 predecessors = new ArrayList<BlockBegin>(2); |
113 loopIndex = -1; | 117 loopIndex = -1; |
607 /** | 611 /** |
608 * Get the number of successors. | 612 * Get the number of successors. |
609 * @return the number of successors | 613 * @return the number of successors |
610 */ | 614 */ |
611 public int numberOfSux() { | 615 public int numberOfSux() { |
612 return end.successors.size(); | 616 return end.blockSuccessorCount(); |
613 } | 617 } |
614 | 618 |
615 /** | 619 /** |
616 * Get the successor at a certain position. | 620 * Get the successor at a certain position. |
617 * @param i the position | 621 * @param i the position |
618 * @return the successor | 622 * @return the successor |
619 */ | 623 */ |
620 public BlockBegin suxAt(int i) { | 624 public BlockBegin suxAt(int i) { |
621 return end.successors.get(i); | 625 return end.blockSuccessor(i); |
622 } | 626 } |
623 | 627 |
624 /** | 628 /** |
625 * Get the number of predecessors. | 629 * Get the number of predecessors. |
626 * @return the number of predecessors | 630 * @return the number of predecessors |