Class BranchEntry
- java.lang.Object
-
- ru.ispras.microtesk.utils.SharedObject<BranchEntry>
-
- ru.ispras.microtesk.test.engine.branch.BranchEntry
-
public final class BranchEntry extends SharedObject<BranchEntry>
BranchEntry
represents a node of the internal representation of a branch structure.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BranchEntry.Type
-
Constructor Summary
Constructors Constructor Description BranchEntry(BranchEntry.Type type)
BranchEntry(BranchEntry.Type type, int registerId, int groupId, int branchLabel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BranchEntry
clone()
java.util.Set<java.lang.Integer>
getBlockCoverage()
Returns the block coverage of the branch instruction.int
getBranchLabel()
Returns the branch label (index of the target instruction in the branch structure).BranchTrace
getBranchTrace()
Returns the execution trace of the branch instruction.int
getGroupId()
Returns the group identifier of the entry.int
getRegisterId()
Returns the register identifier of the branch entry.java.util.Set<java.lang.Integer>
getSlotCoverage()
Returns the slot coverage of the branch instruction.BranchEntry.Type
getType()
Returns the type of the entry.boolean
isBasicBlock()
Checks if the entry is a basic block.boolean
isBranch()
Checks whether the entry is a conditional or an unconditional branch.boolean
isControlCodeInBasicBlock()
boolean
isControlCodeInDelaySlot()
boolean
isDelaySlot()
Checks whether the entry is a delay slot.boolean
isGoto()
Checks whether the entry is an unconditional branch.boolean
isIfThen()
Checks whether the entry is a conditional branch.boolean
isRegisterFirstUse()
Checks whether the register is used for the first time.BranchEntry
newCopy()
Creates a new full copy of the object.void
setBlockCoverage(java.util.Set<java.lang.Integer> blockCoverage)
Sets the block coverage of the branch instruction.void
setBranchLabel(int branchLabel)
Sets the branch label (index of the target instruction in the branch structure).void
setControlCodeInBasicBlock(boolean controlCodeInBasicBlock)
void
setControlCodeInDelaySlot(boolean controlCodeInDelaySlot)
void
setGroupId(int groupId)
Sets the group identifier of the entry.void
setRegisterFirstUse(boolean isRegisterFirstUse)
Specifies whether the register is used for the first time.void
setRegisterId(int registerId)
Sets the register identifier of the branch entry.void
setSlotCoverage(java.util.Set<java.lang.Integer> slotCoverage)
Sets the slot coverage of the branch instruction.void
setType(BranchEntry.Type type)
Sets the type of the entry.java.lang.String
toString()
-
Methods inherited from class ru.ispras.microtesk.utils.SharedObject
copyAll, freeSharedCopies, getCopy, publishSharedCopy, sharedCopy, sharedCopyAll
-
-
-
-
Constructor Detail
-
BranchEntry
public BranchEntry(BranchEntry.Type type, int registerId, int groupId, int branchLabel)
-
BranchEntry
public BranchEntry(BranchEntry.Type type)
-
-
Method Detail
-
getType
public BranchEntry.Type getType()
Returns the type of the entry.- Returns:
- the entry type.
-
setType
public void setType(BranchEntry.Type type)
Sets the type of the entry.- Parameters:
type
- the type to be set.
-
isIfThen
public boolean isIfThen()
Checks whether the entry is a conditional branch.- Returns:
true
if the entry is a conditional branch;false
otherwise.
-
isGoto
public boolean isGoto()
Checks whether the entry is an unconditional branch.- Returns:
true
if the entry is a unconditional branch;false
otherwise.
-
isDelaySlot
public boolean isDelaySlot()
Checks whether the entry is a delay slot.- Returns:
true
if the entry is a delay slot;false
otherwise.
-
isBasicBlock
public boolean isBasicBlock()
Checks if the entry is a basic block.- Returns:
true
if the entry is a basic block;false
otherwise.
-
isBranch
public boolean isBranch()
Checks whether the entry is a conditional or an unconditional branch.- Returns:
true
if the entry is a branch;false
otherwise.
-
getRegisterId
public int getRegisterId()
Returns the register identifier of the branch entry.- Returns:
- the register identifier.
-
setRegisterId
public void setRegisterId(int registerId)
Sets the register identifier of the branch entry.- Parameters:
registerId
- the register identifier to be set.
-
isRegisterFirstUse
public boolean isRegisterFirstUse()
Checks whether the register is used for the first time.- Returns:
- if the register is used for the first time;
false
otherwise.
-
setRegisterFirstUse
public void setRegisterFirstUse(boolean isRegisterFirstUse)
Specifies whether the register is used for the first time.- Parameters:
isRegisterFirstUse
- the value to be set.
-
getGroupId
public int getGroupId()
Returns the group identifier of the entry.- Returns:
- the group identifier.
-
setGroupId
public void setGroupId(int groupId)
Sets the group identifier of the entry.- Parameters:
groupId
- the group identifier to be set.
-
getBranchLabel
public int getBranchLabel()
Returns the branch label (index of the target instruction in the branch structure).- Returns:
- the branch label.
-
setBranchLabel
public void setBranchLabel(int branchLabel)
Sets the branch label (index of the target instruction in the branch structure).- Parameters:
branchLabel
- the branch label to be set.
-
getBranchTrace
public BranchTrace getBranchTrace()
Returns the execution trace of the branch instruction.- Returns:
- the execution trace.
-
getBlockCoverage
public java.util.Set<java.lang.Integer> getBlockCoverage()
Returns the block coverage of the branch instruction.- Returns:
- the block coverage.
-
setBlockCoverage
public void setBlockCoverage(java.util.Set<java.lang.Integer> blockCoverage)
Sets the block coverage of the branch instruction.- Parameters:
blockCoverage
- the block coverage to be set.
-
getSlotCoverage
public java.util.Set<java.lang.Integer> getSlotCoverage()
Returns the slot coverage of the branch instruction.- Returns:
- the slot coverage.
-
setSlotCoverage
public void setSlotCoverage(java.util.Set<java.lang.Integer> slotCoverage)
Sets the slot coverage of the branch instruction.- Parameters:
slotCoverage
- the slot coverage to be set.
-
isControlCodeInBasicBlock
public boolean isControlCodeInBasicBlock()
-
setControlCodeInBasicBlock
public void setControlCodeInBasicBlock(boolean controlCodeInBasicBlock)
-
isControlCodeInDelaySlot
public boolean isControlCodeInDelaySlot()
-
setControlCodeInDelaySlot
public void setControlCodeInDelaySlot(boolean controlCodeInDelaySlot)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
public BranchEntry clone()
- Overrides:
clone
in classjava.lang.Object
-
newCopy
public BranchEntry newCopy()
Description copied from class:SharedObject
Creates a new full copy of the object. This method must call theSharedObject(SharedObject)
copy constructor in order to publish a shared copy.- Specified by:
newCopy
in classSharedObject<BranchEntry>
- Returns:
- New full copy of the object.
-
-