Class MethodState
java.lang.Object
com.offbynull.coroutines.user.MethodState
- All Implemented Interfaces:
Serializable
Do not use -- for internal use only.
Holds on to the state of a method frame.
- Author:
- Kasra Faghihi
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMethodState(String className, int methodId, int continuationPoint, Object[] data, LockState lockState) Do not use -- for internal use only. -
Method Summary
Modifier and TypeMethodDescriptionDo not use -- for internal use only.intDo not use -- for internal use only.Object[]getData()Do not use -- for internal use only.static StringgetIdentifyingFieldName(int methodId, int continuationPointId) Do not use -- for internal use only.Do not use -- for internal use only.intDo not use -- for internal use only.static booleanisValid(ClassLoader classLoader, String className, int methodId, int continuationPointId) Do not use -- for internal use only.
-
Constructor Details
-
MethodState
public MethodState(String className, int methodId, int continuationPoint, Object[] data, LockState lockState) Do not use -- for internal use only.Constructs a
MethodStateobject.- Parameters:
className- name of owner (class) for method at which state was savedmethodId- identifier for method at which state was savedcontinuationPoint- point in the method at which state was saved (does not refer to offset, just an id that's generated by the instrumenter to mark that point)data- locals and operand stack at the point which state was savedlockState- monitors entered at the point which state was saved (may benull)
-
-
Method Details
-
getClassName
Do not use -- for internal use only.Get name of owner (class) for method at which state was saved
- Returns:
- name of owner (class) for method at which state was saved
-
getMethodId
public int getMethodId()Do not use -- for internal use only.Get identifier of method for which state was saved
- Returns:
- ID of method for which state was saved
-
getContinuationPoint
public int getContinuationPoint()Do not use -- for internal use only.Get the point in the code at which state was saved (does not refer to offset, just an id that's generated by the instrumenter to mark that point)
- Returns:
- point in the code at which state was saved
-
getData
Do not use -- for internal use only.Get locals and operand stack at the point which state was saved.
- Returns:
- locals and operand stack at the point which state was saved
-
getLockState
Do not use -- for internal use only.Get the monitors entered at the point which state was saved.
- Returns:
- monitors entered at the point which state was saved
-
isValid
public static boolean isValid(ClassLoader classLoader, String className, int methodId, int continuationPointId) Do not use -- for internal use only.Determine if this method state is valid. Valid means that the method that this method state is for exists and the method is the correct version for this method state.
- Parameters:
classLoader- class loader to use to look for the class (nullwill attempt to use this Object's classloader / the thread's context class loader)className- class namemethodId- method idcontinuationPointId- continuation point id- Returns:
trueif method for this method state exists and is of the correct version,falseotherwise- Throws:
NullPointerException- ifclassNameisnullIllegalArgumentException- ifcontinuationPointId < 0
-
getIdentifyingFieldName
Do not use -- for internal use only.Get the name of the field that will be inserted into a class for some method id and version combination.
- Parameters:
methodId- method idcontinuationPointId- continuation point id- Returns:
- field name
- Throws:
IllegalArgumentException- ifcontinuationPointId < 0
-