trait RecordMethodCallResults extends MethodCallResults with RecordReturnedValues with RecordThrownExceptions
Records the results of the evaluation of the current
method such that the results
can directly be adapted to the calling context and can be used by the caller to continue
the abstract interpretation of the calling method.
The returned value will only be a given parameter, if the given parameter is not mutated. For example, if an array is passed to a method where the content is reified, the returned value will only be mapped back to the parameter value if the array is not changed at all. In other words, the returned value, which may get the pc of the method caller, may refer to any parameter given to the method. Only, if the returned value is a parameter, we know that this specific parameter was not mutated at all.
- Self Type
- RecordMethodCallResults with Domain
- Source
- RecordMethodCallResults.scala
- Alphabetic
- By Inheritance
- RecordMethodCallResults
- RecordThrownExceptions
- RecordReturnedValues
- CustomInitialization
- RecordReturnedValuesInfrastructure
- ReturnInstructionsDomain
- MethodCallResults
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- abstract type ReturnedValue <: (RecordMethodCallResults.this)#DomainValue
This type determines in which way the returned values are recorded.
This type determines in which way the returned values are recorded.
For example, if it is sufficient to just record the last value that was returned by a specific return instruction, then the type could be
DomainValue
and the implementation ofjoinReturnedValues(...)
would just return the last given value. Furthermore,returnedValue
would be the identity function.However, if you have a (more) precise domain you may want to collect all returned values. In this case the type of
ReturnedValue
could be Set[DomainValue].- Definition Classes
- RecordMethodCallResults → RecordReturnedValuesInfrastructure
- abstract type ThrownException <: Set[(RecordMethodCallResults.this)#ExceptionValue]
This type determines in which way thrown exceptions are recorded.
This type determines in which way thrown exceptions are recorded.
For example, if you want to collect all thrown exceptions, then the type of
ThrownException
could beSet[ThrownException]
.- Definition Classes
- RecordMethodCallResults → RecordThrownExceptions
- See also
The implementation of org.opalj.ai.domain.RecordAllThrownExceptions.
The implementation of org.opalj.ai.domain.RecordLastReturnedValues. It follows the same pattern.
Abstract Value Members
- abstract def joinReturnedValues(pc: Int, previouslyReturnedValue: (RecordMethodCallResults.this)#ReturnedValue, value: (RecordMethodCallResults.this)#DomainValue): (RecordMethodCallResults.this)#ReturnedValue
Joins the previously returned value and the newly given
value
.Joins the previously returned value and the newly given
value
. Both values are returned by the same return instruction (samepc
).- pc
The program counter of the return instruction. The returned values are automatically associated with the pc of the instruction. Hence, it is not strictly required to store it in the
ReturnedValue
.
- Attributes
- protected[this]
- Definition Classes
- RecordReturnedValues
- See also
For details study the documentation of the abstract type
ReturnedValue
and study the subclass(es) ofRecordReturnedValues
.
- abstract def joinThrownExceptions(pc: Int, previouslyThrownException: (RecordMethodCallResults.this)#ThrownException, value: (RecordMethodCallResults.this)#ExceptionValue): (RecordMethodCallResults.this)#ThrownException
Joins the previously thrown exception(s) and the newly thrown exception.
Joins the previously thrown exception(s) and the newly thrown exception. Both exceptions are thrown by the same instruction (same
pc
).- Attributes
- protected[this]
- Definition Classes
- RecordThrownExceptions
- Note
The instruction might be an
athrow
instruction or some other instruction that throws an exception.- See also
For details study the documentation of the abstract type
ThrownException
and study the subclass(es) ofRecordThrownExceptions
.
- abstract def recordReturnedValue(pc: Int, value: (RecordMethodCallResults.this)#DomainValue): (RecordMethodCallResults.this)#ReturnedValue
Wraps the given value into a
ReturnedValue
.Wraps the given value into a
ReturnedValue
.- pc
The program counter of the return instruction. The returned values are automatically associated with the pc of the instruction. Hence, it is not strictly required to store it in the
ReturnedValue
.
- Attributes
- protected[this]
- Definition Classes
- RecordReturnedValues
- See also
For details study the documentation of the abstract type
ReturnedValue
and study the subclass(es) ofRecordReturnedValues
.
- abstract def recordThrownException(pc: Int, value: (RecordMethodCallResults.this)#ExceptionValue): (RecordMethodCallResults.this)#ThrownException
Wraps the given value into a
ThrownException
.Wraps the given value into a
ThrownException
.- pc
The program counter of the instruction that throws the exception. It is automatically stored in the map that associates instructions with the exceptions that are thrown.
- Attributes
- protected[this]
- Definition Classes
- RecordThrownExceptions
- See also
For details study the documentation of the abstract type
ThrownException
and study the subclass(es) ofRecordThrownExceptions
.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def abruptMethodExecution(pc: Int, exception: (RecordMethodCallResults.this)#ExceptionValue): Unit
Called by the abstract interpreter when an exception is thrown that is not (guaranteed to be) handled within the same method.
Called by the abstract interpreter when an exception is thrown that is not (guaranteed to be) handled within the same method.
- Definition Classes
- RecordThrownExceptions → ReturnInstructionsDomain
- Note
If the original exception value is
null
(/*E.g.*/throw null;
), then the exception that is actually thrown is a newNullPointerException
. This situation is, however, completely handled by OPAL and the exception value is hence nevernull
.
- def allReturnedValues: IntMap[(RecordMethodCallResults.this)#ReturnedValue]
Returns the set of all returned values.
Returns the set of all returned values.
- Definition Classes
- RecordReturnedValues
- def allThrownExceptions: LongMap[(RecordMethodCallResults.this)#ThrownException]
Returns all thrown exceptions.
Returns all thrown exceptions. The key of the returned map is the pc of the instruction which threw the exception.
- Definition Classes
- RecordThrownExceptions
- def areturn(pc: Int, value: (RecordMethodCallResults.this)#DomainValue): Computation[Nothing, (RecordMethodCallResults.this)#ExceptionValue]
The given
value
, which is a value with computational type reference, is returned by the return instruction with the givenpc
.The given
value
, which is a value with computational type reference, is returned by the return instruction with the givenpc
.- Definition Classes
- RecordReturnedValuesInfrastructure → ReturnInstructionsDomain
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def doRecordReturnedValue(pc: Int, value: (RecordMethodCallResults.this)#DomainValue): Boolean
Records the returned value.
Records the returned value.
- returns
true
if the information about the returned value was updated.
- Attributes
- protected[this]
- Definition Classes
- RecordReturnedValues → RecordReturnedValuesInfrastructure
- def dreturn(pc: Int, value: (RecordMethodCallResults.this)#DomainValue): Computation[Nothing, (RecordMethodCallResults.this)#ExceptionValue]
The given
value
, which is a value with computational type double, is returned by the return instruction with the givenpc
.The given
value
, which is a value with computational type double, is returned by the return instruction with the givenpc
.- Definition Classes
- RecordReturnedValuesInfrastructure → ReturnInstructionsDomain
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def freturn(pc: Int, value: (RecordMethodCallResults.this)#DomainValue): Computation[Nothing, (RecordMethodCallResults.this)#ExceptionValue]
The given
value
, which is a value with computational type float, is returned by the return instruction with the givenpc
.The given
value
, which is a value with computational type float, is returned by the return instruction with the givenpc
.- Definition Classes
- RecordReturnedValuesInfrastructure → ReturnInstructionsDomain
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def initProperties(code: Code, cfJoins: IntTrieSet, initialLocals: (RecordMethodCallResults.this)#Locals): Unit
Override this method to perform custom initialization steps.
Override this method to perform custom initialization steps.
Always use
abstract override
and call the super method; it is recommended to complete the initialization of this domain before calling the super method.- Definition Classes
- RecordReturnedValues → CustomInitialization
- def ireturn(pc: Int, value: (RecordMethodCallResults.this)#DomainValue): Computation[Nothing, (RecordMethodCallResults.this)#ExceptionValue]
The given
value
, which is a value with computational type integer, is returned by the return instruction with the givenpc
.The given
value
, which is a value with computational type integer, is returned by the return instruction with the givenpc
.- Definition Classes
- RecordReturnedValuesInfrastructure → ReturnInstructionsDomain
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def lreturn(pc: Int, value: (RecordMethodCallResults.this)#DomainValue): Computation[Nothing, (RecordMethodCallResults.this)#ExceptionValue]
The given
value
, which is a value with computational type long, is returned by the return instruction with the givenpc
.The given
value
, which is a value with computational type long, is returned by the return instruction with the givenpc
.- Definition Classes
- RecordReturnedValuesInfrastructure → ReturnInstructionsDomain
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def returnVoid(pc: Int): Computation[Nothing, (RecordMethodCallResults.this)#ExceptionValue]
Called when a return instruction with the given
pc
is reached.Called when a return instruction with the given
pc
is reached. In other words, when the method returns normally.- Definition Classes
- RecordMethodCallResults → ReturnInstructionsDomain
- def returnedNormally: Boolean
true
if the method returned due to a("void"|a|i|l|f|d)return
instruction.true
if the method returned due to a("void"|a|i|l|f|d)return
instruction.- Definition Classes
- RecordMethodCallResults → MethodCallResults
- Note
This method may only be called after the abstract interpretation of a method has completed.
- def returnedValue(target: TargetDomain, callerPC: Int): Option[(target)#DomainValue]
Adapts and returns the returned value.
Adapts and returns the returned value.
- Definition Classes
- RecordMethodCallResults → MethodCallResults
- Note
This method is only defined if the method returned normally. In this case
,None
is returned if the method's return type isvoid
;Some(DomainValue)
is returned otherwise.This method may only be called after the abstract interpretation of a method has completed.
- def returnedValueRemapped(callerDomain: TargetDomain, callerPC: Int)(originalOperands: (callerDomain)#Operands, passedParameters: (RecordMethodCallResults.this)#Locals): Option[(callerDomain)#DomainValue]
Remaps the returned value to the domain value used by the calling domain.
Remaps the returned value to the domain value used by the calling domain.
- Definition Classes
- RecordMethodCallResults → MethodCallResults
- Note
Even if the current domain provides origin information then the returned value is not refined by this default implementation. For example, imagine the following code:
def isString(o : Object) : Object = { if(o.isInstanceOf[String]) o // here, we know that o is actually a String. else null }
Here, the value that is returned is the original "object" value; the information that it is a String is not available in the calling method's context. Furthermore, "MultipleReferenceValues" are also not supported. Support of these features requires that the "current" domain is at least the l1.DefaultReferenceValuesDomain which we do not assume here.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def thrownExceptions(target: TargetDomain, callerPC: Int): (target)#ExceptionValues
Adapts and returns the exceptions that are thrown by the called method.
Adapts and returns the exceptions that are thrown by the called method.
In general, for each type of exception there should be at most one
ExceptionValue
.- Definition Classes
- RecordMethodCallResults → MethodCallResults
- Note
This method may only be called after the abstract interpretation of a method has completed.
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated