Class SynchronizationGenerators
- java.lang.Object
-
- com.offbynull.coroutines.instrumenter.SynchronizationGenerators
-
final class SynchronizationGenerators extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.reflect.Method
LOCKSTATE_ENTER_METHOD
private static java.lang.reflect.Method
LOCKSTATE_EXIT_METHOD
private static java.lang.reflect.Constructor<LockState>
LOCKSTATE_INIT_METHOD
private static java.lang.reflect.Method
LOCKSTATE_TOARRAY_METHOD
-
Constructor Summary
Constructors Modifier Constructor Description private
SynchronizationGenerators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.objectweb.asm.tree.InsnList
createMonitorContainer(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to that creates a newLockState
object and saves it to the lockstate variable.static org.objectweb.asm.tree.InsnList
enterMonitorAndStore(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to enter a monitor (top item on the stack) and store it in theLockState
object sitting in the lockstate variable.static org.objectweb.asm.tree.InsnList
enterStoredMonitors(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to enter all monitors in theLockState
object sitting in the lockstate variable.static org.objectweb.asm.tree.InsnList
exitMonitorAndDelete(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to exit a monitor (top item on the stack) and remove it from theLockState
object sitting in the lockstate variable.static org.objectweb.asm.tree.InsnList
exitStoredMonitors(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to exit all monitors in theLockState
object sitting in the lockstate variable.
-
-
-
Field Detail
-
LOCKSTATE_INIT_METHOD
private static final java.lang.reflect.Constructor<LockState> LOCKSTATE_INIT_METHOD
-
LOCKSTATE_ENTER_METHOD
private static final java.lang.reflect.Method LOCKSTATE_ENTER_METHOD
-
LOCKSTATE_EXIT_METHOD
private static final java.lang.reflect.Method LOCKSTATE_EXIT_METHOD
-
LOCKSTATE_TOARRAY_METHOD
private static final java.lang.reflect.Method LOCKSTATE_TOARRAY_METHOD
-
-
Method Detail
-
createMonitorContainer
public static org.objectweb.asm.tree.InsnList createMonitorContainer(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to that creates a newLockState
object and saves it to the lockstate variable.- Parameters:
markerType
- debug marker typelockVars
- variables for lock/synchpoint functionality- Returns:
- instructions to push a new
LockState
object - Throws:
java.lang.NullPointerException
- if any argument isnull
java.lang.IllegalArgumentException
- if lock variables aren't set (the method doesn't contain any monitorenter/monitorexit instructions)
-
enterStoredMonitors
public static org.objectweb.asm.tree.InsnList enterStoredMonitors(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to enter all monitors in theLockState
object sitting in the lockstate variable.- Parameters:
markerType
- debug marker typelockVars
- variables for lock/synchpoint functionality- Returns:
- instructions to enter all monitors in the
LockState
object - Throws:
java.lang.NullPointerException
- if any argument isnull
java.lang.IllegalArgumentException
- if lock variables aren't set (the method doesn't contain any monitorenter/monitorexit instructions)
-
exitStoredMonitors
public static org.objectweb.asm.tree.InsnList exitStoredMonitors(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to exit all monitors in theLockState
object sitting in the lockstate variable.- Parameters:
markerType
- debug marker typelockVars
- variables for lock/synchpoint functionality- Returns:
- instructions to exit all monitors in the
LockState
object - Throws:
java.lang.NullPointerException
- if any argument isnull
java.lang.IllegalArgumentException
- if lock variables aren't set (the method doesn't contain any monitorenter/monitorexit instructions)
-
enterMonitorAndStore
public static org.objectweb.asm.tree.InsnList enterMonitorAndStore(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to enter a monitor (top item on the stack) and store it in theLockState
object sitting in the lockstate variable.- Parameters:
markerType
- debug marker typelockVars
- variables for lock/synchpoint functionality- Returns:
- instructions to enter a monitor and store it in the
LockState
object - Throws:
java.lang.NullPointerException
- if any argument isnull
java.lang.IllegalArgumentException
- if lock variables aren't set (the method doesn't contain any monitorenter/monitorexit instructions)
-
exitMonitorAndDelete
public static org.objectweb.asm.tree.InsnList exitMonitorAndDelete(DebugGenerators.MarkerType markerType, LockVariables lockVars)
Generates instruction to exit a monitor (top item on the stack) and remove it from theLockState
object sitting in the lockstate variable.- Parameters:
markerType
- debug marker typelockVars
- variables for lock/synchpoint functionality- Returns:
- instructions to exit a monitor and remove it from the
LockState
object - Throws:
java.lang.NullPointerException
- if any argument isnull
java.lang.IllegalArgumentException
- if lock variables aren't set (the method doesn't contain any monitorenter/monitorexit instructions)
-
-