List of usage examples for org.objectweb.asm Opcodes ASM4
int ASM4
To view the source code for org.objectweb.asm Opcodes ASM4.
Click Source Link
From source file:org.spongepowered.mod.asm.transformers.PriorityTransformer.java
License:MIT License
private MethodNode createGetGameMethod() { MethodNode methodNode = new MethodNode(Opcodes.ASM4, Opcodes.ACC_PUBLIC, "getGame", "()Lorg/spongepowered/api/Game;", null, null); methodNode.instructions.add(new FieldInsnNode(Opcodes.GETSTATIC, "org/spongepowered/mod/SpongeMod", "instance", "Lorg/spongepowered/mod/SpongeMod;")); methodNode.instructions.add(new MethodInsnNode(Opcodes.INVOKEVIRTUAL, "org/spongepowered/mod/SpongeMod", "getGame", "()Lorg/spongepowered/mod/SpongeGame;", false)); methodNode.instructions.add(new InsnNode(Opcodes.ARETURN)); methodNode.maxLocals = 1;//from w w w . j a v a 2 s .c o m methodNode.maxStack = 1; return methodNode; }
From source file:org.springframework.cglib.core.ClassEmitter.java
License:Apache License
public ClassEmitter() { super(Opcodes.ASM4); }
From source file:org.springframework.cglib.core.ClassEmitter.java
License:Apache License
public CodeEmitter begin_method(int access, Signature sig, Type[] exceptions) { if (classInfo == null) throw new IllegalStateException("classInfo is null! " + this); MethodVisitor v = cv.visitMethod(access, sig.getName(), sig.getDescriptor(), null, TypeUtils.toInternalNames(exceptions)); if (sig.equals(Constants.SIG_STATIC) && !TypeUtils.isInterface(getAccess())) { rawStaticInit = v;//from w w w . j a v a2s.c om MethodVisitor wrapped = new MethodVisitor(Opcodes.ASM4, v) { public void visitMaxs(int maxStack, int maxLocals) { // ignore } public void visitInsn(int insn) { if (insn != Constants.RETURN) { super.visitInsn(insn); } } }; staticInit = new CodeEmitter(this, wrapped, access, sig, exceptions); if (staticHook == null) { // force static hook creation getStaticHook(); } else { staticInit.invoke_static_this(staticHookSig); } return staticInit; } else if (sig.equals(staticHookSig)) { return new CodeEmitter(this, v, access, sig, exceptions) { public boolean isStaticHook() { return true; } }; } else { return new CodeEmitter(this, v, access, sig, exceptions); } }
From source file:org.springframework.cglib.core.ClassNameReader.java
License:Apache License
@SuppressWarnings("unchecked") public static String[] getClassInfo(ClassReader r) { final List array = new ArrayList(); try {/*from w w w .j a v a 2 s. c o m*/ r.accept(new ClassVisitor(Opcodes.ASM4, null) { public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { array.add(name.replace('/', '.')); if (superName != null) { array.add(superName.replace('/', '.')); } for (int i = 0; i < interfaces.length; i++) { array.add(interfaces[i].replace('/', '.')); } throw EARLY_EXIT; } }, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); } catch (EarlyExitException e) { } return (String[]) array.toArray(new String[] {}); }
From source file:org.springframework.cglib.core.DebuggingClassWriter.java
License:Apache License
public DebuggingClassWriter(int flags) { super(Opcodes.ASM4, new ClassWriter(flags)); }
From source file:org.springframework.cglib.transform.AbstractClassTransformer.java
License:Apache License
protected AbstractClassTransformer() { super(Opcodes.ASM4); }
From source file:org.springframework.cglib.transform.AnnotationVisitorTee.java
License:Apache License
public AnnotationVisitorTee(AnnotationVisitor av1, AnnotationVisitor av2) { super(Opcodes.ASM4); this.av1 = av1; this.av2 = av2; }
From source file:org.springframework.cglib.transform.ClassTransformer.java
License:Apache License
public ClassTransformer() { super(Opcodes.ASM4); }
From source file:org.springframework.cglib.transform.ClassTransformerTee.java
License:Apache License
public ClassTransformerTee(ClassVisitor branch) { super(Opcodes.ASM4); this.branch = branch; }
From source file:org.springframework.cglib.transform.ClassVisitorTee.java
License:Apache License
public ClassVisitorTee(ClassVisitor cv1, ClassVisitor cv2) { super(Opcodes.ASM4); this.cv1 = cv1; this.cv2 = cv2; }