public class SystemState extends Object
Modifier and Type | Field and Description |
---|---|
KernelState |
ks
current execution state of the VM (stored separately by VM)
|
protected int |
nAdvancedCGs |
Transition |
trail |
UncaughtException |
uncaughtException
uncaught exception in current transition
|
Modifier | Constructor and Description |
---|---|
protected |
SystemState() |
|
SystemState(Config config,
VM vm)
Creates a new system state.
|
Modifier and Type | Method and Description |
---|---|
void |
activateGC() |
protected void |
advance(VM vm,
ChoiceGenerator<?> cg) |
protected void |
advanceAllCascadedParents(VM vm,
ChoiceGenerator<?> cg) |
protected boolean |
advanceCascadedParent(VM vm,
ChoiceGenerator<?> cg) |
protected boolean |
advanceCurCg(VM vm) |
void |
backtrackTo(Object backtrackData) |
boolean |
breakTransition() |
void |
checkGC()
check if number of allocations since last GC exceed the maxAllocGC
threshold, perform on-the-fly GC if yes.
|
void |
clearAtomic() |
void |
decAtomic() |
void |
executeNextTransition(VM vm)
enter all instructions that constitute the next transition.
|
void |
gcIfNeeded() |
Object |
getBacktrackData() |
ChoiceGenerator<?> |
getChoiceGenerator()
answer the ChoiceGenerator that is used in the current transition
|
ChoiceGenerator<?> |
getChoiceGenerator(String id) |
ChoiceGenerator<?>[] |
getChoiceGenerators()
return the whole stack of CGs of the current path
|
<T extends ChoiceGenerator<?>> |
getChoiceGeneratorsOfType(Class<T> cgType) |
ChoiceGenerator<?> |
getCurrentChoiceGenerator(ChoiceGenerator<?> cgPrev) |
ChoiceGenerator<?> |
getCurrentChoiceGenerator(String id) |
<T extends ChoiceGenerator<?>> |
getCurrentChoiceGenerator(String id,
Class<T> cgType) |
<T extends ChoiceGenerator<?>> |
getCurrentChoiceGeneratorOfType(Class<T> cgType) |
ChoiceGenerator<?>[] |
getCurrentChoiceGenerators() |
ThreadChoiceGenerator |
getCurrentSchedulingPoint()
this returns the most recently registered ThreadChoiceGenerator that is
also a scheduling point, or 'null' if there is none in the list of current CGs
|
Heap |
getHeap() |
int |
getId() |
<T extends ChoiceGenerator<?>> |
getInsnChoiceGeneratorOfType(Class<T> cgType,
Instruction insn,
ChoiceGenerator<?> cgPrev) |
KernelState |
getKernelState() |
<T extends ChoiceGenerator<?>> |
getLastChoiceGeneratorOfType(Class<T> cgType) |
int |
getLiveThreadCount() |
ChoiceGenerator<?> |
getNextChoiceGenerator() |
int |
getNonDaemonThreadCount() |
Object |
getRestoreData() |
ClosedMemento |
getRestorer(Object key) |
boolean |
getRetainAttributes() |
int |
getRunnableThreadCount() |
SchedulerFactory |
getSchedulerFactory() |
int |
getThreadCount() |
Transition |
getTrail() |
UncaughtException |
getUncaughtException() |
boolean |
hasRestorer(Object key) |
void |
incAtomic()
use those with extreme care, it overrides scheduling choices
|
boolean |
initializeNextTransition(VM vm)
reset the SystemState and initialize the next CG.
|
boolean |
isAtomic() |
boolean |
isBlockedInAtomicSection() |
boolean |
isBoring() |
boolean |
isForced() |
boolean |
isIgnored() |
boolean |
isInitState() |
boolean |
isInteresting() |
protected void |
notifyChoiceGeneratorSet(VM vm,
ChoiceGenerator<?> cg) |
void |
putRestorer(Object key,
ClosedMemento restorer)
call the provided restorer each time we get back to this state
|
void |
recordSteps(boolean cond) |
void |
removeAllNextChoiceGenerators()
remove the whole chain of currently registered nextCGs
|
void |
removeNextChoiceGenerator()
remove the current 'nextCg'
Note this has to be called in a loop if all cascaded CGs have to be removed
|
void |
restoreTo(Object backtrackData) |
void |
retainAttributes(boolean b) |
void |
setBlockedInAtomicSection() |
void |
setBoring(boolean b) |
protected void |
setExecThread(VM vm) |
void |
setForced(boolean b) |
void |
setId(int newId) |
void |
setIgnored(boolean b)
this can be called anywhere from within a transition, to revert it and
go on with the next choice.
|
void |
setInteresting(boolean b) |
void |
setMandatoryNextChoiceGenerator(ChoiceGenerator<?> cg,
String failMsg) |
boolean |
setNextChoiceGenerator(ChoiceGenerator<?> cg)
set the ChoiceGenerator to be used in the next transition
|
void |
setStartThread(ThreadInfo ti) |
public KernelState ks
public Transition trail
public UncaughtException uncaughtException
protected int nAdvancedCGs
public void setStartThread(ThreadInfo ti)
public int getId()
public void setId(int newId)
public void recordSteps(boolean cond)
public void incAtomic()
public void decAtomic()
public void clearAtomic()
public boolean isAtomic()
public boolean isBlockedInAtomicSection()
public void setBlockedInAtomicSection()
public Transition getTrail()
public SchedulerFactory getSchedulerFactory()
public KernelState getKernelState()
public Heap getHeap()
public ChoiceGenerator<?> getChoiceGenerator()
public ChoiceGenerator<?> getChoiceGenerator(String id)
public ChoiceGenerator<?>[] getChoiceGenerators()
public <T extends ChoiceGenerator<?>> T[] getChoiceGeneratorsOfType(Class<T> cgType)
public <T extends ChoiceGenerator<?>> T getLastChoiceGeneratorOfType(Class<T> cgType)
public <T extends ChoiceGenerator<?>> T getCurrentChoiceGeneratorOfType(Class<T> cgType)
public <T extends ChoiceGenerator<?>> T getCurrentChoiceGenerator(String id, Class<T> cgType)
public ChoiceGenerator<?> getCurrentChoiceGenerator(String id)
public ChoiceGenerator<?> getCurrentChoiceGenerator(ChoiceGenerator<?> cgPrev)
public ThreadChoiceGenerator getCurrentSchedulingPoint()
public ChoiceGenerator<?>[] getCurrentChoiceGenerators()
public <T extends ChoiceGenerator<?>> T getInsnChoiceGeneratorOfType(Class<T> cgType, Instruction insn, ChoiceGenerator<?> cgPrev)
public ChoiceGenerator<?> getNextChoiceGenerator()
public boolean setNextChoiceGenerator(ChoiceGenerator<?> cg)
public void setMandatoryNextChoiceGenerator(ChoiceGenerator<?> cg, String failMsg)
public void removeNextChoiceGenerator()
public void removeAllNextChoiceGenerators()
public Object getBacktrackData()
public void backtrackTo(Object backtrackData)
public Object getRestoreData()
public void restoreTo(Object backtrackData)
public void retainAttributes(boolean b)
public boolean getRetainAttributes()
public void setIgnored(boolean b)
public boolean isIgnored()
public void setForced(boolean b)
public boolean isForced()
public void setInteresting(boolean b)
public boolean isInteresting()
public void setBoring(boolean b)
public boolean isBoring()
public boolean isInitState()
public int getNonDaemonThreadCount()
public int getThreadCount()
public int getRunnableThreadCount()
public int getLiveThreadCount()
public UncaughtException getUncaughtException()
public void activateGC()
public boolean hasRestorer(Object key)
public ClosedMemento getRestorer(Object key)
public void putRestorer(Object key, ClosedMemento restorer)
key
- usually the object this restorer encapsulatesrestorer
- the ClosedMemento that restores the state of the object
it encapsulates once we backtrack/restore this program state
Note that restorers are called in the order of registration, but in
general it is not a good idea to depend on order since restorers can
be set from different locations (listeners, peers, instructions)public void gcIfNeeded()
public void checkGC()
public boolean initializeNextTransition(VM vm)
VM.forward()
public void executeNextTransition(VM vm)
VM.forward()
protected void setExecThread(VM vm)
protected void advance(VM vm, ChoiceGenerator<?> cg)
protected void advanceAllCascadedParents(VM vm, ChoiceGenerator<?> cg)
protected boolean advanceCascadedParent(VM vm, ChoiceGenerator<?> cg)
protected boolean advanceCurCg(VM vm)
protected void notifyChoiceGeneratorSet(VM vm, ChoiceGenerator<?> cg)
public boolean breakTransition()