Class SynchronizationGenerators
java.lang.Object
com.offbynull.coroutines.instrumenter.SynchronizationGenerators
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Methodprivate static final Methodprivate static final Constructor<LockState> private static final Method -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.objectweb.asm.tree.InsnListcreateMonitorContainer(DebugGenerators.MarkerType markerType, LockVariables lockVars) Generates instruction to that creates a newLockStateobject and saves it to the lockstate variable.static org.objectweb.asm.tree.InsnListenterMonitorAndStore(DebugGenerators.MarkerType markerType, LockVariables lockVars) Generates instruction to enter a monitor (top item on the stack) and store it in theLockStateobject sitting in the lockstate variable.static org.objectweb.asm.tree.InsnListenterStoredMonitors(DebugGenerators.MarkerType markerType, LockVariables lockVars) Generates instruction to enter all monitors in theLockStateobject sitting in the lockstate variable.static org.objectweb.asm.tree.InsnListexitMonitorAndDelete(DebugGenerators.MarkerType markerType, LockVariables lockVars) Generates instruction to exit a monitor (top item on the stack) and remove it from theLockStateobject sitting in the lockstate variable.static org.objectweb.asm.tree.InsnListexitStoredMonitors(DebugGenerators.MarkerType markerType, LockVariables lockVars) Generates instruction to exit all monitors in theLockStateobject sitting in the lockstate variable.
-
Field Details
-
LOCKSTATE_INIT_METHOD
-
LOCKSTATE_ENTER_METHOD
-
LOCKSTATE_EXIT_METHOD
-
LOCKSTATE_TOARRAY_METHOD
-
-
Constructor Details
-
SynchronizationGenerators
private SynchronizationGenerators()
-
-
Method Details
-
createMonitorContainer
public static org.objectweb.asm.tree.InsnList createMonitorContainer(DebugGenerators.MarkerType markerType, LockVariables lockVars) Generates instruction to that creates a newLockStateobject and saves it to the lockstate variable.- Parameters:
markerType- debug marker typelockVars- variables for lock/synchpoint functionality- Returns:
- instructions to push a new
LockStateobject - Throws:
NullPointerException- if any argument isnullIllegalArgumentException- 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 theLockStateobject sitting in the lockstate variable.- Parameters:
markerType- debug marker typelockVars- variables for lock/synchpoint functionality- Returns:
- instructions to enter all monitors in the
LockStateobject - Throws:
NullPointerException- if any argument isnullIllegalArgumentException- 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 theLockStateobject sitting in the lockstate variable.- Parameters:
markerType- debug marker typelockVars- variables for lock/synchpoint functionality- Returns:
- instructions to exit all monitors in the
LockStateobject - Throws:
NullPointerException- if any argument isnullIllegalArgumentException- 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 theLockStateobject 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
LockStateobject - Throws:
NullPointerException- if any argument isnullIllegalArgumentException- 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 theLockStateobject 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
LockStateobject - Throws:
NullPointerException- if any argument isnullIllegalArgumentException- if lock variables aren't set (the method doesn't contain any monitorenter/monitorexit instructions)
-