Class MethodState
- java.lang.Object
-
- com.offbynull.coroutines.user.MethodState
-
- All Implemented Interfaces:
java.io.Serializable
public final class MethodState extends java.lang.Object implements java.io.SerializableDo not use -- for internal use only.Holds on to the state of a method frame.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringclassNameprivate intcontinuationPointprivate java.lang.Object[]dataprivate LockStatelockStateprivate intmethodIdprivate MethodStatenextprivate MethodStatepreviousprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description MethodState(java.lang.String className, int methodId, int continuationPoint, java.lang.Object[] data, LockState lockState)Do not use -- for internal use only.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetClassName()Do not use -- for internal use only.intgetContinuationPoint()Do not use -- for internal use only.java.lang.Object[]getData()Do not use -- for internal use only.static java.lang.StringgetIdentifyingFieldName(int methodId, int continuationPointId)Do not use -- for internal use only.LockStategetLockState()Do not use -- for internal use only.intgetMethodId()Do not use -- for internal use only.(package private) MethodStategetNext()Do not use -- for internal use only.(package private) MethodStategetPrevious()Do not use -- for internal use only.static booleanisValid(java.lang.ClassLoader classLoader, java.lang.String className, int methodId, int continuationPointId)Do not use -- for internal use only.(package private) voidsetNext(MethodState next)Do not use -- for internal use only.(package private) voidsetPrevious(MethodState previous)Do not use -- for internal use only.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
className
private final java.lang.String className
-
methodId
private final int methodId
-
continuationPoint
private final int continuationPoint
-
data
private final java.lang.Object[] data
-
lockState
private final LockState lockState
-
next
private MethodState next
-
previous
private MethodState previous
-
-
Constructor Detail
-
MethodState
public MethodState(java.lang.String className, int methodId, int continuationPoint, java.lang.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 Detail
-
getClassName
public java.lang.String 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
public java.lang.Object[] 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
public LockState 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
-
getNext
MethodState getNext()
Do not use -- for internal use only.Get the next method state.
- Returns:
- next method state
-
setNext
void setNext(MethodState next)
Do not use -- for internal use only.Set the next method state.
- Parameters:
next- next method state
-
getPrevious
MethodState getPrevious()
Do not use -- for internal use only.Get the previous method state.
- Returns:
- previous method state
-
setPrevious
void setPrevious(MethodState previous)
Do not use -- for internal use only.Set the previous method state.
- Parameters:
previous- previous method state
-
isValid
public static boolean isValid(java.lang.ClassLoader classLoader, java.lang.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:
java.lang.NullPointerException- ifclassNameisnulljava.lang.IllegalArgumentException- ifcontinuationPointId < 0
-
getIdentifyingFieldName
public static java.lang.String getIdentifyingFieldName(int methodId, int continuationPointId)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:
java.lang.IllegalArgumentException- ifcontinuationPointId < 0
-
-