FGThreads

final class FGThreads

Class used only by class FlowGraphBuilder. Holds a collection of control flow arrows that reach a same point.

Methods

add

protected void add(Block block, int test, int cas)

Adds one thread to this FGThreads. Adds the thread coming from “block”, when the “test” goes to case “cas”.

block

protected Block block()

Assumes this FGThread is single and simple.

Returns

origin Block of this single thread.

concat

protected void concat(FGThreads newThreads)

Concatenates “newThreads” in front of this FGThreads: Warning: reuses ThreadListCell’s of “newThreads”, which will be broken.

convergeToBlock

protected void convergeToBlock(Block destinationBlock, boolean inCycle, boolean traceOn)

Makes all threads flow to the “destinationBlock”: Does not modify the contents of the current threads.

convergeToInstr

protected void convergeToInstr(Instruction instruction, TapList<Block> allBlocks, Unit unit, SymbolTable symbolTable, TapList<Instruction> parallelControls, boolean traceOn)

Makes all threads flow to a new instruction built for “tree”: Builds a new Block only when necessary (2 incoming threads…) Modifies the contents of the current threads: at the end, current FGThreads is just at the end of the Block that received “tree”.

empty

protected void empty()

Removes all threads in current FGThreads.

isNotEmpty

protected boolean isNotEmpty()

reTypeThread

protected void reTypeThread(int newTest, int newCas)

Assumes this FGThread is single and simple. Re-types it with the given newTest and newCas.

toString

public String toString()