Class LocalsStateGenerators
- java.lang.Object
-
- com.offbynull.coroutines.instrumenter.LocalsStateGenerators
-
final class LocalsStateGenerators extends java.lang.Object
Utility class to generate bytecode instructions that save/load the local variables table.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
LocalsStateGenerators()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.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.
-
-
-
Method Detail
-
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:
java.lang.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:
java.lang.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:
java.lang.NullPointerException
- if any argument isnull
-
-