public abstract class BlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>> extends Object implements IBlockState<BlockStateType,CallContextType,CallEdgeType>
| Modifier and Type | Class and Description |
|---|---|
static class |
BlockState.Properties |
| Modifier | Constructor and Description |
|---|---|
protected |
BlockState(BlockState<BlockStateType,CallContextType,CallEdgeType> x)
Constructs a new state as a copy of the given state.
|
|
BlockState(GenericSolver.SolverInterface c,
BasicBlock block)
Constructs a new none-state (representing the empty set of concrete states).
|
| Modifier and Type | Method and Description |
|---|---|
void |
check()
Checks that this state is consistent.
|
void |
checkNoDanglingRefs()
Checks for dangling references.
|
void |
checkOwner(BasicBlock other_block,
CallContextType other_context)
Checks that the owner block and context are the given.
|
void |
clearEffects()
Clears effects and summarized sets (for function entry).
|
void |
clearOrdinaryRegisters()
Clears the registers, starting from
AbstractNode.FIRST_ORDINARY_REG, and excluding property list values. |
void |
clearRegisters()
Clears all registers.
|
abstract BlockStateType |
clone()
Constructs a new state as a copy of this state.
|
void |
copyUnknowns(BlockState<BlockStateType,CallContextType,CallEdgeType> calledge_state)
Copies the calledge state the current state.
|
void |
declareAndWriteVariable(String varname,
Value value,
boolean allow_overwrite)
Declares the given variable (or function) and assigns the given value to it.
|
Value |
deleteProperty(Collection<ObjectLabel> objlabels,
Str propertystr)
Deletes the given property.
|
Value |
deleteVariable(String varname)
Deletes the given variable.
|
protected String |
diff(BlockState<BlockStateType,CallContextType,CallEdgeType> old)
Returns a string description of the differences between this state and the given one.
|
boolean |
equals(Object obj)
Checks whether the given state is equal to this one.
|
void |
freezeBasisStore()
Sets the current store contents as the basis store.
|
void |
gc()
Runs garbage collection on the contents of this state.
|
BasicBlock |
getBasicBlock()
Returns the basic block owning this state.
|
CallContextType |
getContext()
Returns the call context for this state.
|
BlockState.Properties |
getEnumProperties(Collection<ObjectLabel> objlabels)
Returns a description of the names of the enumerable properties of the given objects.
|
ExecutionContext |
getExecutionContext()
Returns the execution context.
|
StateExtras |
getExtras()
Returns the extra stuff.
|
static int |
getNumberOfMakeWritableRegistersCalls()
Returns the total number of makeWritableRegisters operations.
|
static int |
getNumberOfMakeWritableStoreCalls()
Returns the total number of makeWritableStore operations.
|
int |
getNumberOfRegisters()
Returns the size of the registers map.
|
static int |
getNumberOfStatesCreated()
Returns the total number of BlockState objects created.
|
Obj |
getObject(ObjectLabel objlabel,
boolean writable)
Looks up an object in the store.
|
Set<ObjectLabel> |
getPrototypesUsedForUnknown(ObjectLabel objlabel) |
Set<ObjectLabel> |
getPrototypeWithProperty(ObjectLabel objlabel,
String propertyname)
Returns the set of objects in the prototype chain that contain the property.
|
ScopeChain |
getScopeChain()
Returns the scope chain.
|
GenericSolver.SolverInterface |
getSolverInterface()
Returns the solver interface.
|
Map<ObjectLabel,Obj> |
getStore()
Returns the store (excluding the basis store).
|
int |
getStoreSize()
Returns the number of objects in the store, excluding the basis store.
|
Summarized |
getSummarized()
Returns the summarized sets.
|
int |
hashCode()
Computes the hash code for this state.
|
Value |
hasInstance(Collection<ObjectLabel> prototype,
Value v)
Models [[HasInstance]] (for instanceof).
|
Bool |
hasProperty(Collection<ObjectLabel> objlabels,
String propertyname)
Checks whether the given property is present in the given objects.
|
boolean |
isNone()
Checks whether this abstract state represents the empty set of concrete states.
|
boolean |
isRegisterDefined(int reg)
Returns true if the given register is defined.
|
boolean |
mergeForInEnd(BlockState<BlockStateType,CallContextType,CallEdgeType> parallel_state,
String loop_var)
Merges parallel_state into the current state.
|
Value |
mergeFunctionReturn(BlockState<BlockStateType,CallContextType,CallEdgeType> caller_state,
BlockState<BlockStateType,CallContextType,CallEdgeType> calledge_state,
BlockState<BlockStateType,CallContextType,CallEdgeType> caller_entry_state,
Summarized callee_summarized,
Value returnval)
Replaces all definitely non-modified parts of this state by the corresponding parts of the given states.
|
void |
multiplyObject(ObjectLabel objlabel)
Moves the given object from singleton to summary, such that it represents
an unknown number of concrete objects.
|
void |
newObject(ObjectLabel objlabel)
Adds an object label, representing a new empty object, to the store.
|
Value |
popRegister()
Pops a value from the register list.
|
void |
popScopeChain()
Pops the top item off the scope chain.
|
String |
printObject(Value v)
Prints the objects of the given value.
|
static String |
printObjectOrigins(Value v)
Prints the source locations of the origins of the objects of the given value.
|
protected boolean |
propagate(BlockState<BlockStateType,CallContextType,CallEdgeType> s)
Propagates the given state into this state.
|
void |
pushRegister(Value value)
Pushes the given value onto the register list.
|
void |
pushScopeChain(Set<ObjectLabel> objlabels)
Pushes a new item onto the scope chain.
|
Value |
readInternalPrototype(Collection<ObjectLabel> objlabels)
Returns the value of the internal prototype of the given objects.
|
Value |
readInternalValue(Collection<ObjectLabel> objlabels)
Returns the value of the internal value property of the given objects.
|
ScopeChain |
readObjectScope(ObjectLabel objlabel)
Returns the value of the internal scope property of the given objects.
|
Value |
readPropertyDirect(Collection<ObjectLabel> objlabels,
String propertyname)
Returns the value of the given property in the objects.
|
Value |
readPropertyValue(Collection<ObjectLabel> objlabels,
Str propertystr)
8.6.2.1 [[Get]]
Returns the value of the given property in the given objects.
|
Value |
readPropertyValue(Collection<ObjectLabel> objlabels,
String propertyname)
8.6.2.1 [[Get]]
Returns the value of the given property in the given objects.
|
Value |
readPropertyWithAttributes(Collection<ObjectLabel> objlabels,
Str propertystr)
Returns the value of the given property in the given objects.
|
Value |
readPropertyWithAttributes(Collection<ObjectLabel> objlabels,
String propertyname)
Returns the value of the given property in the given objects.
|
Value |
readRegister(int reg)
Reads the value of the given register.
|
Value |
readThis()
Returns the value of 'this'.
|
Set<ObjectLabel> |
readThisObjects()
Returns the object value of 'this'.
|
Value |
readVariable(String varname,
Collection<ObjectLabel> base_objs)
Returns the value of the given variable.
|
void |
reduce()
Reduces this state.
|
protected void |
remove(BlockState<BlockStateType,CallContextType,CallEdgeType> other) |
void |
removeRegister(int reg)
Removes the given register (strong update).
|
static void |
reset()
Resets the global counters.
|
void |
setBasicBlock(BasicBlock block)
Sets the basic block owning this state.
|
void |
setContext(CallContextType context)
Sets the call context.
|
void |
setExecutionContext(ExecutionContext e)
Sets the execution context.
|
void |
setToNone()
Sets this state to the none-state (representing the empty set of concrete states).
|
void |
setToUnknown()
Sets all object properties to 'unknown'.
|
void |
stackObjectLabels()
Adds object labels used in current registers and execution
context to stacked object labels.
|
String |
toDot()
Produces a graphviz dot representation of this state.
|
String |
toString()
Returns a description of this abstract state.
|
String |
toStringBrief()
As
toString() but excludes registers and non-modified objects and properties. |
String |
toStringModified()
Prints the modified parts of the store.
|
void |
transform(CallEdgeType edge,
BlockStateType callee_entry_state,
Function callee,
CallContextType callee_context)
Transforms this state according to the given edge.
|
void |
transformInverse(CallEdgeType edge,
BlockStateType callee_entry_state)
Transforms this state inversely according to the given edge.
|
void |
trim(BlockStateType s)
Introduces 'unknown' values in this state according to the given function entry state.
|
void |
writeInternalPrototype(Collection<ObjectLabel> objlabels,
Value value)
Assigns the given value to the internal prototype links of the given objects.
|
void |
writeInternalPrototype(ObjectLabel objlabel,
Value value)
Assigns the given value to the internal prototype link of the given object.
|
void |
writeInternalValue(Collection<ObjectLabel> objlabels,
Value value)
Assign the given value to the internal [[Value]] property of the given objects.
|
void |
writeInternalValue(ObjectLabel objlabel,
Value value)
Assigns the given value to the internal [[Value]] property of the given object.
|
void |
writeObjectScope(ObjectLabel objlabel,
ScopeChain scope)
Assigns a copy of the given scope chain to the internal scope property of the given object.
|
void |
writeProperty(Collection<ObjectLabel> objlabels,
Str propertystr,
Value value,
boolean put,
boolean force_weak)
8.6.2.2 [[Put]]
Assigns the given value to the given property of the given objects.
|
void |
writeProperty(ObjectLabel objlabel,
String propertyname,
Value value)
8.6.2.2 [[Put]]
Assigns the given value to the given property of the given object.
|
void |
writePropertyWithAttributes(Collection<ObjectLabel> objlabels,
String propertyname,
Value value)
Assigns the given value to the given property of the given objects, with attributes.
|
void |
writePropertyWithAttributes(Collection<ObjectLabel> objlabels,
String propertyname,
Value value,
boolean real)
Assigns the given value to the given property of the given objects, with attributes.
|
void |
writePropertyWithAttributes(ObjectLabel objlabel,
String propertyname,
Value value)
Assigns the given value to the given property of the given object, with attributes.
|
void |
writeRegister(int reg,
Value value)
Assigns the given value to the given register (strong update).
|
Set<ObjectLabel> |
writeVariable(String varname,
Value value,
boolean real)
Assigns the given value to the given variable.
|
finalize, getClass, notify, notifyAll, wait, wait, waitdiff, propagate, removeprotected BlockState(BlockState<BlockStateType,CallContextType,CallEdgeType> x)
public BlockState(GenericSolver.SolverInterface c, BasicBlock block)
public void check()
check in interface IBlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>>checkNoDanglingRefs()public void checkNoDanglingRefs()
AnalysisException - if dangling references are foundpublic void checkOwner(BasicBlock other_block, CallContextType other_context)
AnalysisException - if mismatchpublic void clearEffects()
public void clearOrdinaryRegisters()
AbstractNode.FIRST_ORDINARY_REG, and excluding property list values.public void clearRegisters()
public abstract BlockStateType clone()
clone in interface IBlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>>clone in class Objectpublic void copyUnknowns(BlockState<BlockStateType,CallContextType,CallEdgeType> calledge_state)
public void declareAndWriteVariable(String varname, Value value, boolean allow_overwrite)
public Value deleteProperty(Collection<ObjectLabel> objlabels, Str propertystr)
public Value deleteVariable(String varname)
deleteProperty(Collection, Str)protected String diff(BlockState<BlockStateType,CallContextType,CallEdgeType> old)
public boolean equals(Object obj)
public void freezeBasisStore()
public void gc()
Options.isGCDisabled() or Options.isRecencyDisabled() is set.public BasicBlock getBasicBlock()
public CallContextType getContext()
public BlockState.Properties getEnumProperties(Collection<ObjectLabel> objlabels)
public ExecutionContext getExecutionContext()
public StateExtras getExtras()
public static int getNumberOfMakeWritableRegistersCalls()
public static int getNumberOfMakeWritableStoreCalls()
public int getNumberOfRegisters()
public static int getNumberOfStatesCreated()
public Obj getObject(ObjectLabel objlabel, boolean writable)
public Set<ObjectLabel> getPrototypesUsedForUnknown(ObjectLabel objlabel)
public Set<ObjectLabel> getPrototypeWithProperty(ObjectLabel objlabel, String propertyname)
public ScopeChain getScopeChain()
public GenericSolver.SolverInterface getSolverInterface()
public Map<ObjectLabel,Obj> getStore()
public int getStoreSize()
public Summarized getSummarized()
public int hashCode()
public Value hasInstance(Collection<ObjectLabel> prototype, Value v)
prototype - external prototype of the second argument to instanceofv - first argument to instanceofpublic Bool hasProperty(Collection<ObjectLabel> objlabels, String propertyname)
public boolean isNone()
IBlockStateisNone in interface IBlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>>public boolean isRegisterDefined(int reg)
public boolean mergeForInEnd(BlockState<BlockStateType,CallContextType,CallEdgeType> parallel_state, String loop_var)
public Value mergeFunctionReturn(BlockState<BlockStateType,CallContextType,CallEdgeType> caller_state, BlockState<BlockStateType,CallContextType,CallEdgeType> calledge_state, BlockState<BlockStateType,CallContextType,CallEdgeType> caller_entry_state, Summarized callee_summarized, Value returnval)
public void multiplyObject(ObjectLabel objlabel)
public void newObject(ObjectLabel objlabel)
public Value popRegister()
public void popScopeChain()
public static String printObjectOrigins(Value v)
protected boolean propagate(BlockState<BlockStateType,CallContextType,CallEdgeType> s)
public void pushRegister(Value value)
public void pushScopeChain(Set<ObjectLabel> objlabels)
public Value readInternalPrototype(Collection<ObjectLabel> objlabels)
public Value readInternalValue(Collection<ObjectLabel> objlabels)
public ScopeChain readObjectScope(ObjectLabel objlabel)
public Value readPropertyDirect(Collection<ObjectLabel> objlabels, String propertyname)
public Value readPropertyValue(Collection<ObjectLabel> objlabels, Str propertystr)
public Value readPropertyValue(Collection<ObjectLabel> objlabels, String propertyname)
public Value readPropertyWithAttributes(Collection<ObjectLabel> objlabels, Str propertystr)
public Value readPropertyWithAttributes(Collection<ObjectLabel> objlabels, String propertyname)
public Value readRegister(int reg)
public Value readThis()
public Set<ObjectLabel> readThisObjects()
public Value readVariable(String varname, Collection<ObjectLabel> base_objs)
varname - the variable namebase_objs - collection where base objects are added (ignored if null)public void reduce()
gc()protected void remove(BlockState<BlockStateType,CallContextType,CallEdgeType> other)
public void removeRegister(int reg)
public static void reset()
public void setBasicBlock(BasicBlock block)
public void setContext(CallContextType context)
public void setExecutionContext(ExecutionContext e)
public void setToNone()
public void setToUnknown()
public void stackObjectLabels()
public String toDot()
IBlockStatetoDot in interface IBlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>>public String toString()
public String toStringBrief()
toString() but excludes registers and non-modified objects and properties.toStringBrief in interface IBlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>>public String toStringModified()
public void transform(CallEdgeType edge, BlockStateType callee_entry_state, Function callee, CallContextType callee_context)
IBlockStatetransform in interface IBlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>>public void transformInverse(CallEdgeType edge, BlockStateType callee_entry_state)
IBlockStatetransformInverse in interface IBlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>>public void trim(BlockStateType s)
trim in interface IBlockState<BlockStateType extends BlockState<BlockStateType,CallContextType,CallEdgeType>,CallContextType extends ICallContext<CallContextType>,CallEdgeType extends CallEdge<BlockStateType>>public void writeInternalPrototype(Collection<ObjectLabel> objlabels, Value value)
public void writeInternalPrototype(ObjectLabel objlabel, Value value)
public void writeInternalValue(Collection<ObjectLabel> objlabels, Value value)
public void writeInternalValue(ObjectLabel objlabel, Value value)
public void writeObjectScope(ObjectLabel objlabel, ScopeChain scope)
public void writeProperty(Collection<ObjectLabel> objlabels, Str propertystr, Value value, boolean put, boolean force_weak)
put - if set, attributes are cleared or copied from the old value according to 8.6.2.2force_weak - if set, force weak update disregarding objlabelspublic void writeProperty(ObjectLabel objlabel, String propertyname, Value value)
public void writePropertyWithAttributes(Collection<ObjectLabel> objlabels, String propertyname, Value value)
public void writePropertyWithAttributes(Collection<ObjectLabel> objlabels, String propertyname, Value value, boolean real)
real - if set, the modified flag if set if the value changes as result of the operationpublic void writePropertyWithAttributes(ObjectLabel objlabel, String propertyname, Value value)
public void writeRegister(int reg,
Value value)
public Set<ObjectLabel> writeVariable(String varname, Value value, boolean real)
varname - the variable namevalue - the new valuereal - if set, the modified flag if set if the value changes as result of the operationCopyright © 2012 Aarhus University