public interface DfaMemoryState
Modifier and Type | Method and Description |
---|---|
boolean |
applyCondition(DfaCondition dfaCond) |
boolean |
applyContractCondition(DfaCondition dfaCond) |
boolean |
areEqual(DfaValue value1,
DfaValue value2)
Returns true if given two values are known to be equal
|
boolean |
checkNotNullable(DfaValue value) |
DfaMemoryState |
createClosureState() |
DfaMemoryState |
createCopy() |
void |
emptyStack() |
void |
flushFields() |
void |
flushVariable(DfaVariableValue variable) |
DfType |
getDfType(DfaValue value) |
PsiType |
getPsiType(DfaValue value) |
RelationType |
getRelation(DfaValue left,
DfaValue right)
Returns a relation between given values within this state, if known
|
DfaValue |
getStackValue(int offset)
Reads a value from the stack at given offset from the top without popping it
|
DfType |
getUnboxedDfType(DfaValue value) |
boolean |
isEmptyStack() |
boolean |
isEphemeral() |
boolean |
isNotNull(DfaValue dfaVar) |
boolean |
isNull(DfaValue dfaVar) |
void |
markEphemeral()
Ephemeral means a state that was created when considering a method contract and checking if one of its arguments is null.
|
boolean |
meetDfType(DfaValue value,
DfType dfType)
Updates value dfType if it's compatible with current value state.
|
DfaValue |
peek()
Reads a value from the top of the stack without popping it
|
DfaValue |
pop()
Pops single value from the top of the stack and returns it
|
void |
push(DfaValue value)
Pushes given value to the stack
|
void |
setDfType(DfaValue value,
DfType dfType)
Forcibly sets the supplied dfType to given value if given value state can be memoized.
|
void |
setVarValue(DfaVariableValue var,
DfaValue value) |
boolean |
shouldCompareByEquals(DfaValue dfaLeft,
DfaValue dfaRight)
Returns true if two given values should be compared by content, rather than by reference.
|
DfaMemoryState createCopy()
DfaMemoryState createClosureState()
DfaValue pop()
java.util.EmptyStackException
- if stack is emptyDfaValue peek()
java.util.EmptyStackException
- if stack is emptyDfaValue getStackValue(int offset)
offset
- value from the stack (0 = top of stack, 1 = the next one, etc.)java.lang.IndexOutOfBoundsException
- if offset is negativevoid push(DfaValue value)
value
- to pushvoid emptyStack()
void setVarValue(DfaVariableValue var, DfaValue value)
RelationType getRelation(DfaValue left, DfaValue right)
left
- first valueright
- second valueboolean applyCondition(DfaCondition dfaCond)
boolean areEqual(DfaValue value1, DfaValue value2)
value1
- first value to checkvalue2
- second value to checkboolean applyContractCondition(DfaCondition dfaCond)
boolean meetDfType(DfaValue value, DfType dfType)
value
- value to updatedfType
- wanted typevoid setDfType(DfaValue value, DfType dfType)
meetDfType(DfaValue, DfType)
should be used as it narrows existing type.value
- value to update.dfType
- type to assign to value. Note that type might be adjusted, e.g. to be compatible with value declared PsiType.DfType getDfType(DfaValue value)
value
- value to get the type ofDfType getUnboxedDfType(DfaValue value)
value
- value to get the type of; if value is a primitive wrapper, it will be unboxed before fetching the DfTypePsiType getPsiType(DfaValue value)
value
- value to get the type ofvoid flushFields()
void flushVariable(DfaVariableValue variable)
boolean isNull(DfaValue dfaVar)
boolean checkNotNullable(DfaValue value)
boolean isNotNull(DfaValue dfaVar)
void markEphemeral()
boolean isEphemeral()
boolean isEmptyStack()
boolean shouldCompareByEquals(DfaValue dfaLeft, DfaValue dfaRight)
dfaLeft
- left valuedfaRight
- right value