Constructor and Description |
---|
State(GenericSolver.SolverInterface c,
BasicBlock block)
Constructs a new none-state (representing the empty set of concrete states).
|
Modifier and Type | Method and Description |
---|---|
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.
|
void |
clearVariableObject()
Clears the variable object pointer in the execution context.
|
State |
clone()
Constructs a new state as a copy of this state.
|
java.lang.String |
diff(State old)
Returns a string description of the differences between this state and the given one.
|
void |
freezeBasisStore()
Sets the current store contents as the basis store.
|
void |
gc(Value extra)
Runs garbage collection on the contents of this state.
|
BasicBlock |
getBasicBlock()
Returns the basic block for this state.
|
Context |
getContext()
Returns the context for this state.
|
ExecutionContext |
getExecutionContext()
Returns the execution context.
|
StateExtras |
getExtras()
Returns the extra stuff.
|
MustEquals |
getMustEquals()
Returns the must-equals information.
|
MustReachingDefs |
getMustReachingDefs()
Returns the reaching definitions information.
|
static int |
getNumberOfMakeWritableStoreCalls()
Returns the total number of makeWritableStore operations.
|
static int |
getNumberOfStatesCreated()
Returns the total number of State objects created.
|
Obj |
getObject(ObjectLabel objlabel,
boolean writable)
Looks up an object in the store.
|
ObjProperties |
getProperties(java.util.Collection<ObjectLabel> objlabels,
ObjProperties.PropertyQuery flags)
Returns a description of the names of the [enumerable] properties of the given objects [and their prototypes].
|
java.util.Set<ObjectLabel> |
getPrototypesUsedForUnknown(ObjectLabel objlabel) |
java.util.Set<ObjectLabel> |
getPrototypeWithProperty(ObjectLabel objlabel,
PKeys propertyName)
Returns the set of objects in the prototype chain that contain the property.
|
java.util.List<Value> |
getRegisters()
Returns the list of registers.
|
ScopeChain |
getScopeChain()
Returns the scope chain.
|
GenericSolver.SolverInterface |
getSolverInterface()
Returns the solver interface.
|
java.util.Set<BlockAndContext<Context>> |
getStackedFunctions()
Returns the functions that appear on the stack.
|
java.util.Set<ObjectLabel> |
getStackedObjects()
Returns the object labels that appear on the stack.
|
java.util.Map<ObjectLabel,Obj> |
getStore()
Returns the store (excluding the basis store).
|
Obj |
getStoreDefault()
Returns the store default object.
|
Summarized |
getSummarized()
Returns the summarized sets.
|
boolean |
hasExceptionRegisterValue()
Checks whether the exception register has a value.
|
Value |
hasInstance(java.util.Collection<ObjectLabel> prototype,
Value v)
Models [[HasInstance]] (for instanceof).
|
boolean |
hasReturnRegisterValue()
Checks whether the return register has a value.
|
boolean |
isBottom()
Checks whether this abstract state is the bottom abstract state.
|
boolean |
isRegisterDefined(int reg)
Returns true if the given register is defined.
|
void |
localize(State s)
Introduces 'unknown' values in this state according to the given function entry state.
|
void |
makeWritableStore()
Makes store writable (for copy-on-write).
|
ObjectLabel |
materializeObj(ObjectLabel summary,
boolean definitely_only_one)
Materializes a singleton object from the given summary object.
|
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.
|
void |
popScopeChain()
Pops the top item off the scope chain.
|
java.lang.String |
printObject(Value v)
Prints the objects of the given value.
|
boolean |
propagate(State s,
boolean funentry,
boolean widen)
Propagates the given state into this state.
|
boolean |
propagateObj(ObjectLabel objlabel_to,
State state_from,
ObjectLabel objlabel_from,
boolean modified,
boolean widen)
Propagates objlabel2 from state2 into objlabel1 in this state.
|
void |
pushScopeChain(java.util.Set<ObjectLabel> objlabels)
Pushes a new item onto the scope chain.
|
void |
putObject(ObjectLabel objlabel,
Obj obj)
Sets an object in the store.
|
Value |
readInternalPrototype(java.util.Collection<ObjectLabel> objlabels)
Returns the value of the internal prototype of the given objects.
|
Value |
readInternalValue(java.util.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 |
readProperty(ObjectProperty p,
boolean partial)
Reads the designated property value.
|
Value |
readRegister(int reg)
Reads the value of the given register.
|
Value |
readThis()
Returns the value of 'this'.
|
java.util.Set<ObjectLabel> |
readThisObjects()
Returns the value of 'this'.
|
Value |
readVariableDirect(java.lang.String var)
Reads a variable directly from the current variable object, without considering the full scope chain.
|
void |
reduce(Value extra)
Reduces this state.
|
void |
removeObject(ObjectLabel objlabel)
Removes an object in the store.
|
void |
removeObjectsEqualToDefault(boolean default_none_at_entry)
Removes objects that are equal to the default object.
|
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(Context context)
Sets the context.
|
void |
setExecutionContext(ExecutionContext e)
Sets the execution context.
|
void |
setMustReachingDefs(MustReachingDefs must_reaching_defs)
Sets the must reaching definitions.
|
void |
setRegisters(java.util.List<Value> registers)
Sets the list of registers.
|
void |
setStacked(java.util.Set<ObjectLabel> so,
java.util.Set<BlockAndContext<Context>> sf)
Sets the object labels and functions that appear on the stack.
|
void |
setStoreDefault(Obj obj)
Sets the store default object.
|
void |
setToBottom()
Sets this state to the bottom abstract state.
|
void |
stackObjectLabels()
Adds object labels used in current registers and execution
context to stacked object labels.
|
void |
summarize(java.util.Set<ObjectLabel> objs)
Summarizes the given objects.
|
java.lang.String |
toDot()
Produces a graphviz dot representation of this state.
|
java.lang.String |
toString()
Returns a description of this abstract state.
|
java.lang.String |
toStringBrief()
As
toString() but excludes registers and non-modified objects and properties. |
java.lang.String |
toStringModified()
Prints the modified parts of the store.
|
Context |
transform(CallEdge edge,
Context edge_context,
java.util.Map<Context,State> callee_entry_states,
BasicBlock callee)
Transforms this state according to the given edge.
|
boolean |
transformInverse(CallEdge edge,
BasicBlock callee,
Context callee_context)
Transforms this state inversely according to the given edge.
|
void |
writeInternalPrototype(java.util.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(java.util.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 |
writeRegister(int reg,
Value value)
Assigns the given value to the given register (strong update).
|
void |
writeRegister(int reg,
Value value,
boolean ordinary)
Assigns the given value to the given register (strong update).
|
public State(GenericSolver.SolverInterface c, BasicBlock block)
public void clearEffects()
public void clearOrdinaryRegisters()
AbstractNode.FIRST_ORDINARY_REG
, and excluding property list values.public void clearRegisters()
public void clearVariableObject()
public State clone()
public java.lang.String diff(State old)
public void freezeBasisStore()
public void gc(Value extra)
OptionValues.isGCDisabled()
or OptionValues.isRecencyDisabled()
is set.public BasicBlock getBasicBlock()
IState
getBasicBlock
in interface IState<State,Context,CallEdge>
public Context getContext()
IState
getContext
in interface IState<State,Context,CallEdge>
public ExecutionContext getExecutionContext()
public StateExtras getExtras()
public MustEquals getMustEquals()
public MustReachingDefs getMustReachingDefs()
public static int getNumberOfMakeWritableStoreCalls()
public static int getNumberOfStatesCreated()
public Obj getObject(ObjectLabel objlabel, boolean writable)
public ObjProperties getProperties(java.util.Collection<ObjectLabel> objlabels, ObjProperties.PropertyQuery flags)
public java.util.Set<ObjectLabel> getPrototypesUsedForUnknown(ObjectLabel objlabel)
public java.util.Set<ObjectLabel> getPrototypeWithProperty(ObjectLabel objlabel, PKeys propertyName)
public java.util.List<Value> getRegisters()
public ScopeChain getScopeChain()
public GenericSolver.SolverInterface getSolverInterface()
public java.util.Set<BlockAndContext<Context>> getStackedFunctions()
public java.util.Set<ObjectLabel> getStackedObjects()
public java.util.Map<ObjectLabel,Obj> getStore()
public Obj getStoreDefault()
public Summarized getSummarized()
public boolean hasExceptionRegisterValue()
public Value hasInstance(java.util.Collection<ObjectLabel> prototype, Value v)
prototype
- external prototype of the second argument to instanceofv
- first argument to instanceofpublic boolean hasReturnRegisterValue()
public boolean isBottom()
IState
public boolean isRegisterDefined(int reg)
public void localize(State s)
public void makeWritableStore()
public ObjectLabel materializeObj(ObjectLabel summary, boolean definitely_only_one)
definitely_only_one
- set to true if the object has been created only once since function entrypublic void multiplyObject(ObjectLabel objlabel)
public void newObject(ObjectLabel objlabel)
public void popScopeChain()
public java.lang.String printObject(Value v)
public boolean propagate(State s, boolean funentry, boolean widen)
public boolean propagateObj(ObjectLabel objlabel_to, State state_from, ObjectLabel objlabel_from, boolean modified, boolean widen)
modified
- if true, set modified flag on written valuespublic void pushScopeChain(java.util.Set<ObjectLabel> objlabels)
public void putObject(ObjectLabel objlabel, Obj obj)
public Value readInternalPrototype(java.util.Collection<ObjectLabel> objlabels)
public Value readInternalValue(java.util.Collection<ObjectLabel> objlabels)
public ScopeChain readObjectScope(ObjectLabel objlabel)
public Value readProperty(ObjectProperty p, boolean partial)
public Value readRegister(int reg)
public Value readThis()
public java.util.Set<ObjectLabel> readThisObjects()
public Value readVariableDirect(java.lang.String var)
public void removeObject(ObjectLabel objlabel)
public void removeObjectsEqualToDefault(boolean default_none_at_entry)
public void removeRegister(int reg)
public static void reset()
public void setBasicBlock(BasicBlock block)
public void setContext(Context context)
public void setExecutionContext(ExecutionContext e)
public void setMustReachingDefs(MustReachingDefs must_reaching_defs)
public void setRegisters(java.util.List<Value> registers)
public void setStacked(java.util.Set<ObjectLabel> so, java.util.Set<BlockAndContext<Context>> sf)
public void setStoreDefault(Obj obj)
public void setToBottom()
IState
setToBottom
in interface IState<State,Context,CallEdge>
public void stackObjectLabels()
public void summarize(java.util.Set<ObjectLabel> objs)
public java.lang.String toDot()
IState
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringBrief()
toString()
but excludes registers and non-modified objects and properties.toStringBrief
in interface IState<State,Context,CallEdge>
public java.lang.String toStringModified()
public Context transform(CallEdge edge, Context edge_context, java.util.Map<Context,State> callee_entry_states, BasicBlock callee)
IState
public boolean transformInverse(CallEdge edge, BasicBlock callee, Context callee_context)
IState
transformInverse
in interface IState<State,Context,CallEdge>
public void writeInternalPrototype(java.util.Collection<ObjectLabel> objlabels, Value value)
public void writeInternalPrototype(ObjectLabel objlabel, Value value)
public void writeInternalValue(java.util.Collection<ObjectLabel> objlabels, Value value)
public void writeInternalValue(ObjectLabel objlabel, Value value)
public void writeObjectScope(ObjectLabel objlabel, ScopeChain scope)
public void writeRegister(int reg, Value value)
public void writeRegister(int reg, Value value, boolean ordinary)
ordinary
- if set, kill must-equals information for that registerCopyright © 2009-2019 Aarhus University