public class SASM
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static WeakKeyValueMap<java.lang.ClassLoader,IByteCodeClassLoader> |
SHARED_CLASSLOADERS
Shared ClassLoader cache.
|
static boolean |
SHARED_LOADERS_MODE
Enables the shared bytecode classloader mode.
|
Constructor and Description |
---|
SASM() |
Modifier and Type | Method and Description |
---|---|
static IByteCodeClassLoader |
createByteCodeClassLoader(java.lang.ClassLoader... parents)
Creates a byte code ClassLoader.
|
static IByteCodeClassLoader |
getByteCodeClassLoader(java.lang.ClassLoader parent)
Generates a ByteCodeClassLoader for loading a generated class.
|
static IByteCodeClassLoader |
getByteCodeClassLoader(java.lang.ClassLoader parent,
boolean sharedloaders)
Generates a ByteCodeClassLoader for loading a generated class.
|
static ClassNode |
getClassNode(java.lang.Class<?> clazz,
java.lang.ClassLoader classloader)
Get a class node for a class.
|
static void |
makeBasicType(InsnList nl,
Type type)
Make a value a basic type.
|
static void |
makeObject(InsnList nl,
Type type)
Make a value to an object.
|
static int |
makeObject(InsnList nl,
Type arg,
int pos)
Make a value to an object.
|
static void |
makeReturn(InsnList nl,
Type type)
Make a suitable return statement.
|
static void |
pushImmediate(InsnList nl,
int immediate)
Push an immediate (constant) integer value onto the stack
with the best set of instructions.
|
static void |
pushImmediate(InsnList nl,
long immediate)
Push an immediate (constant) long value onto the stack
with the best set of instructions.
|
static java.lang.Class<?> |
toClass(java.lang.String name,
byte[] data,
java.lang.ClassLoader loader,
java.security.ProtectionDomain domain)
Transform byte Array into Class and define it in classloader.
|
public static boolean SHARED_LOADERS_MODE
protected static final WeakKeyValueMap<java.lang.ClassLoader,IByteCodeClassLoader> SHARED_CLASSLOADERS
public static void pushImmediate(InsnList nl, int immediate)
nl
- The instruction list.immediate
- The immediate value.public static void pushImmediate(InsnList nl, long immediate)
nl
- The instruction list.immediate
- The immediate value.public static void makeObject(InsnList nl, Type type)
nl
- The instruction list.type
- The value type.public static int makeObject(InsnList nl, Type arg, int pos)
nl
- The instruction list.type
- The value type.pos
- The position of the value on the registers (default=1, 0 is this).public static void makeBasicType(InsnList nl, Type type)
nl
- The instruction list.type
- The value type.public static void makeReturn(InsnList nl, Type type)
nl
- The instruction list.type
- The value type.public static java.lang.Class<?> toClass(java.lang.String name, byte[] data, java.lang.ClassLoader loader, java.security.ProtectionDomain domain)
null
, if the class is not valid, such as Map.entry "inner Classes".public static ClassNode getClassNode(java.lang.Class<?> clazz, java.lang.ClassLoader classloader)
clazz
- The clazz.public static IByteCodeClassLoader getByteCodeClassLoader(java.lang.ClassLoader parent)
parent
- Parent ClassLoader.sharedloader
- Set true, to use shared loaders.public static IByteCodeClassLoader getByteCodeClassLoader(java.lang.ClassLoader parent, boolean sharedloaders)
parent
- Parent ClassLoader.sharedloader
- Set true, to use shared loaders.public static final IByteCodeClassLoader createByteCodeClassLoader(java.lang.ClassLoader... parents)
parents
- ClassLoader parents, first parameters is the getParent() ClassLoader.