Class ASMUtil
- java.lang.Object
-
- org.glassfish.pfl.dynamic.codegen.impl.ASMUtil
-
public class ASMUtil extends java.lang.Object
Simple class containing a few ASM-related utilities and dynamic attributes needs for the byte code generator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ASMUtil.FixStackSizeClassVisitor
private static class
ASMUtil.FixStackSizeMethodVisitor
static class
ASMUtil.LineNumberTable
static class
ASMUtil.RequiredEmitterType
static class
ASMUtil.VariablesInMethod
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ASMUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
bcName(Type type)
private static void
displayNode(java.io.PrintStream ps, java.lang.String msg, Node node)
private static byte[]
fixStackSize(byte[] code)
static byte[]
generate(java.lang.ClassLoader cl, ClassGeneratorImpl cg, ImportList imports, java.util.Properties options, java.io.PrintStream debugOutput)
Given a completed ClassGeneratorImpl, use ASM to construct the byte array representing the compiled class.static void
generateSourceCode(java.io.PrintStream ps, ClassGeneratorImpl cg, ImportList imports, java.util.Properties options)
static void
generateSourceCode(java.lang.String sourceGenDir, ClassGeneratorImpl cg, ImportList imports, java.util.Properties options)
static java.io.File
getFile(java.lang.String genDir, java.lang.String className, java.lang.String suffix)
private static void
verify(java.io.PrintStream ps, byte[] classData)
-
-
-
Field Detail
-
makeLabel
private static NullaryFunction<MyLabel> makeLabel
-
stackFrameSlot
static Attribute<java.lang.Integer> stackFrameSlot
-
getEmitter
static Attribute<EmitterFactory.Emitter> getEmitter
-
setEmitter
static Attribute<EmitterFactory.Emitter> setEmitter
-
emitter
static Attribute<EmitterFactory.Emitter> emitter
-
requiredEmitterType
static Attribute<ASMUtil.RequiredEmitterType> requiredEmitterType
-
lastBlock
static Attribute<BlockStatement> lastBlock
-
ctr
static Attribute<java.lang.Integer> ctr
-
tableMaker
private static NullaryFunction<ASMUtil.LineNumberTable> tableMaker
-
lineNumberTable
static Attribute<ASMUtil.LineNumberTable> lineNumberTable
-
vmMaker
private static NullaryFunction<ASMUtil.VariablesInMethod> vmMaker
-
variablesInMethod
static Attribute<ASMUtil.VariablesInMethod> variablesInMethod
-
-
Method Detail
-
bcName
public static java.lang.String bcName(Type type)
-
displayNode
private static void displayNode(java.io.PrintStream ps, java.lang.String msg, Node node)
-
generateSourceCode
public static void generateSourceCode(java.io.PrintStream ps, ClassGeneratorImpl cg, ImportList imports, java.util.Properties options) throws java.io.IOException
- Throws:
java.io.IOException
-
getFile
public static java.io.File getFile(java.lang.String genDir, java.lang.String className, java.lang.String suffix)
-
generateSourceCode
public static void generateSourceCode(java.lang.String sourceGenDir, ClassGeneratorImpl cg, ImportList imports, java.util.Properties options) throws java.io.IOException
- Throws:
java.io.IOException
-
fixStackSize
private static byte[] fixStackSize(byte[] code)
-
generate
public static byte[] generate(java.lang.ClassLoader cl, ClassGeneratorImpl cg, ImportList imports, java.util.Properties options, java.io.PrintStream debugOutput)
Given a completed ClassGeneratorImpl, use ASM to construct the byte array representing the compiled class.
-
verify
private static void verify(java.io.PrintStream ps, byte[] classData)
-
-