Class MethodState

java.lang.Object
com.offbynull.coroutines.user.MethodState
All Implemented Interfaces:
Serializable

public final class MethodState extends Object implements Serializable
Do not use -- for internal use only.

Holds on to the state of a method frame.

See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • className

      private final String className
    • methodId

      private final int methodId
    • continuationPoint

      private final int continuationPoint
    • data

      private final Object[] data
    • lockState

      private final LockState lockState
    • next

      private MethodState next
    • previous

      private MethodState previous
  • Constructor Details

    • MethodState

      public MethodState(String className, int methodId, int continuationPoint, Object[] data, LockState lockState)
      Do not use -- for internal use only.

      Constructs a MethodState object.

      Parameters:
      className - name of owner (class) for method at which state was saved
      methodId - identifier for method at which state was saved
      continuationPoint - 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 saved
      lockState - monitors entered at the point which state was saved (may be null)
  • Method Details

    • getClassName

      public 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 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(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 (null will attempt to use this Object's classloader / the thread's context class loader)
      className - class name
      methodId - method id
      continuationPointId - continuation point id
      Returns:
      true if method for this method state exists and is of the correct version, false otherwise
      Throws:
      NullPointerException - if className is null
      IllegalArgumentException - if continuationPointId < 0
    • getIdentifyingFieldName

      public static 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 id
      continuationPointId - continuation point id
      Returns:
      field name
      Throws:
      IllegalArgumentException - if continuationPointId < 0