Exemplo n.º 1
0
 public void addBeforeFixed(FixedNode node, FixedWithNextNode newNode) {
   assert node != null && newNode != null && node.isAlive() && newNode.isAlive()
       : "cannot add " + newNode + " before " + node;
   assert node.predecessor() != null && node.predecessor() instanceof FixedWithNextNode
       : "cannot add " + newNode + " before " + node;
   assert newNode.next() == null : newNode;
   assert !(node instanceof AbstractMergeNode);
   FixedWithNextNode pred = (FixedWithNextNode) node.predecessor();
   pred.setNext(newNode);
   newNode.setNext(node);
 }
Exemplo n.º 2
0
 public void replaceFixedWithFixed(FixedWithNextNode node, FixedWithNextNode replacement) {
   assert node != null && replacement != null && node.isAlive() && replacement.isAlive()
       : "cannot replace " + node + " with " + replacement;
   FixedNode next = node.next();
   node.setNext(null);
   replacement.setNext(next);
   node.replaceAndDelete(replacement);
   if (node == start) {
     setStart((StartNode) replacement);
   }
 }
Exemplo n.º 3
0
 public void addAfterFixed(FixedWithNextNode node, FixedNode newNode) {
   assert node != null && newNode != null && node.isAlive() && newNode.isAlive()
       : "cannot add " + newNode + " after " + node;
   FixedNode next = node.next();
   node.setNext(newNode);
   if (next != null) {
     assert newNode instanceof FixedWithNextNode;
     FixedWithNextNode newFixedWithNext = (FixedWithNextNode) newNode;
     assert newFixedWithNext.next() == null;
     newFixedWithNext.setNext(next);
   }
 }
Exemplo n.º 4
0
 public void replaceSplitWithFixed(
     ControlSplitNode node, FixedWithNextNode replacement, AbstractBeginNode survivingSuccessor) {
   assert node != null && replacement != null && node.isAlive() && replacement.isAlive()
       : "cannot replace " + node + " with " + replacement;
   assert survivingSuccessor != null;
   node.clearSuccessors();
   replacement.setNext(survivingSuccessor);
   node.replaceAndDelete(replacement);
 }
Exemplo n.º 5
0
 public static void unlinkFixedNode(FixedWithNextNode fixed) {
   assert fixed.next() != null && fixed.predecessor() != null && fixed.isAlive();
   FixedNode next = fixed.next();
   fixed.setNext(null);
   fixed.replaceAtPredecessor(next);
 }