Class LocalsStateGenerators
java.lang.Object
com.offbynull.coroutines.instrumenter.LocalsStateGenerators
Utility class to generate bytecode instructions that save/load the local variables table.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StorageSizescomputeSizes(org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame) Compute sizes required for the storage arrays that will contain the local variables table at this frame.static org.objectweb.asm.tree.InsnListloadLocals(DebugGenerators.MarkerType markerType, StorageVariables storageVars, org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame) Generates instructions to load the local variables table.static org.objectweb.asm.tree.InsnListsaveLocals(DebugGenerators.MarkerType markerType, StorageVariables storageVars, org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame) Generates instructions to save the local variables table.
-
Constructor Details
-
LocalsStateGenerators
private LocalsStateGenerators()
-
-
Method Details
-
loadLocals
public static org.objectweb.asm.tree.InsnList loadLocals(DebugGenerators.MarkerType markerType, StorageVariables storageVars, org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame) Generates instructions to load the local variables table.- Parameters:
markerType- debug marker typestorageVars- variables to load locals fromframe- execution frame at the instruction for which the local variables table is to be restored- Returns:
- instructions to load the local variables table from an array
- Throws:
NullPointerException- if any argument isnull
-
saveLocals
public static org.objectweb.asm.tree.InsnList saveLocals(DebugGenerators.MarkerType markerType, StorageVariables storageVars, org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame) Generates instructions to save the local variables table.- Parameters:
markerType- debug marker typestorageVars- variables to store locals in toframe- execution frame at the instruction where the local variables table is to be saved- Returns:
- instructions to save the local variables table in to an array
- Throws:
NullPointerException- if any argument isnull
-
computeSizes
public static StorageSizes computeSizes(org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame) Compute sizes required for the storage arrays that will contain the local variables table at this frame.- Parameters:
frame- frame to compute for- Returns:
- size required by each storage array
- Throws:
NullPointerException- if any argument isnull
-