org.objectweb.asm.Opcodes# ASM6 ( ) 源码实例Demo

下面列出了org.objectweb.asm.Opcodes# ASM6 ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。


/**
 * Create this adapter with a set of {@link MethodRefs}, the internal class name for the method, values given from
 * {@link org.objectweb.asm.ClassVisitor#visitMethod(int, String, String, String, String[])}, and a
 * {@link MethodVisitor} to delegate to.
 */
public MethodBranchAdapter(MethodRefs refs, String className, int access, String name,
    String desc, String signature, String[] exceptions, MethodVisitor mv) {
  super(Opcodes.ASM6, access, name, desc, signature, exceptions);
  this.refs = refs;
  this.className = className;
  this.mv = mv;
}
 
源代码2 项目: jpeek   文件: TypesOf.java

/**
 * Ctor.
 * @param sign Method signature
 */
TypesOf(final String sign) {
    super(Opcodes.ASM6);
    this.types = new LinkedList<>();
    this.singature = sign;
    this.rtype = new AtomicReference<>();
    this.ret = new AtomicBoolean();
}
 
源代码3 项目: JReFrameworker   文件: SignatureVisitor.java

/**
 * Constructs a new {@link SignatureVisitor}.
 *
 * @param api the ASM API version implemented by this visitor. Must be one of {@link
 *     Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}.
 */
public SignatureVisitor(final int api) {
  if (api != Opcodes.ASM6 && api != Opcodes.ASM5 && api != Opcodes.ASM4 && api != Opcodes.ASM7) {
    throw new IllegalArgumentException();
  }
  this.api = api;
}
 

public TryCatchBlockSorter(
    final MethodVisitor methodVisitor,
    final int access,
    final String name,
    final String descriptor,
    final String signature,
    final String[] exceptions) {
  this(Opcodes.ASM6, methodVisitor, access, name, descriptor, signature, exceptions);
  if (getClass() != TryCatchBlockSorter.class) {
    throw new IllegalStateException();
  }
}
 
源代码5 项目: AVM   文件: ClassMetering.java

public MethodVisitor visitMethod(
        final int access,
        final String name,
        final String descriptor,
        final String signature,
        final String[] exceptions) {
    // Capture the visitor which actually constitutes the pipeline - we will need to do another pass before this one.
    MethodVisitor realVisitor = super.visitMethod(access, name, descriptor, signature, exceptions);
    
    // We use a MethodNode since we want to capture the bytecode to walk it twice.
    // The actual final write is done on the realVisitor.
    return new MethodNode(Opcodes.ASM6, access, name, descriptor, signature, exceptions) {
        @Override
        public void visitEnd() {
            // Let the superclass do what it wants to finish this.
            super.visitEnd();

            // Create the read-only visitor and use it to extract the block data.
            BlockBuildingMethodVisitor readingVisitor = new BlockBuildingMethodVisitor();
            this.accept(readingVisitor);
            List<BasicBlock> blocks = readingVisitor.getBlockList();

            // Apply the block fee for the bytecodes it contains.
            for (BasicBlock block : blocks) {
                long feeForBlock = calculateBlockFee(block);
                block.setEnergyCost(feeForBlock);
            }

            // We can now build the injection visitor over the real visitor, and accept it in order to add the instrumentation.
            ChargeEnergyInjectionVisitor instrumentingVisitor = new ChargeEnergyInjectionVisitor(realVisitor, blocks);
            this.accept(instrumentingVisitor);
        }
    };
}
 

public ArraysRequiringAnalysisMethodNode(final int access,
                                     final String name,
                                     final String descriptor,
                                     final String signature,
                                     final String[] exceptions,
                                     MethodVisitor mv,
                                     String className,
                                     ClassHierarchy hierarchy)
{
    super(Opcodes.ASM6, access, name, descriptor, signature, exceptions);
    this.className = className;
    this.mv = mv;
    this.hierarchy = hierarchy;
}
 
源代码7 项目: AVM   文件: ArrayWrappingInterpreter.java

ArrayWrappingInterpreter(ClassHierarchy hierarchy) {
  super(Opcodes.ASM6);
  this.hierarchy = hierarchy;
}
 
源代码8 项目: AVM   文件: RejectionClassVisitor.java

public RejectionClassVisitor(PreRenameClassAccessRules preRenameClassAccessRules, NamespaceMapper namespaceMapper, boolean preserveDebuggability) {
    super(Opcodes.ASM6);
    this.preRenameClassAccessRules = preRenameClassAccessRules;
    this.namespaceMapper = namespaceMapper;
    this.preserveDebuggability = preserveDebuggability;
}
 
源代码9 项目: jarjar   文件: EmptyClassVisitor.java

@Override
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
  return new AnnotationVisitor(Opcodes.ASM6) {};
}
 

public ArraysRequiringAnalysisClassVisitor(ClassHierarchy hierarchy) {
    super(Opcodes.ASM6);
    this.hierarchy = hierarchy;
}
 
源代码11 项目: AVM   文件: UserClassMappingVisitor.java

public UserClassMappingVisitor(NamespaceMapper mapper, boolean preserveDebuggability) {
    super(Opcodes.ASM6);
    
    this.mapper = mapper;
    this.preserveDebuggability = preserveDebuggability;
}
 

CheckAnnotationAdapter(final AnnotationVisitor av, final boolean named) {
  super(Opcodes.ASM6, av);
  this.named = named;
}
 
源代码13 项目: AVM   文件: AutomaticGraphVisitor.java

public AutomaticGraphVisitor() {
    super(Opcodes.ASM6);
}
 
源代码14 项目: JByteMod-Beta   文件: CheckFieldAdapter.java

/**
 * Constructs a new {@link CheckFieldAdapter}. <i>Subclasses must not use this
 * constructor</i>. Instead, they must use the
 * {@link #CheckFieldAdapter(int, FieldVisitor)} version.
 * 
 * @param fv
 *          the field visitor to which this adapter must delegate calls.
 * @throws IllegalStateException
 *           If a subclass calls this constructor.
 */
public CheckFieldAdapter(final FieldVisitor fv) {
  this(Opcodes.ASM6, fv);
  if (getClass() != CheckFieldAdapter.class) {
    throw new IllegalStateException();
  }
}
 
源代码15 项目: JByteMod-Beta   文件: MethodNode.java

/**
 * Constructs an uninitialized {@link MethodNode}. <i>Subclasses must not use
 * this constructor</i>. Instead, they must use the {@link #MethodNode(int)}
 * version.
 * 
 * @throws IllegalStateException
 *           If a subclass calls this constructor.
 */
public MethodNode() {
  this(Opcodes.ASM6);
  if (getClass() != MethodNode.class) {
    throw new IllegalStateException();
  }
}
 
源代码16 项目: JByteMod-Beta   文件: TypeAnnotationNode.java

/**
 * Constructs a new {@link AnnotationNode}. <i>Subclasses must not use this
 * constructor</i>. Instead, they must use the
 * {@link #TypeAnnotationNode(int, int, TypePath, String)} version.
 * 
 * @param typeRef
 *          a reference to the annotated type. See {@link TypeReference}.
 * @param typePath
 *          the path to the annotated type argument, wildcard bound, array
 *          element type, or static inner type within 'typeRef'. May be
 *          <tt>null</tt> if the annotation targets 'typeRef' as a whole.
 * @param desc
 *          the class descriptor of the annotation class.
 * @throws IllegalStateException
 *           If a subclass calls this constructor.
 */
public TypeAnnotationNode(final int typeRef, final TypePath typePath, final String desc) {
  this(Opcodes.ASM6, typeRef, typePath, desc);
  if (getClass() != TypeAnnotationNode.class) {
    throw new IllegalStateException();
  }
}
 
源代码17 项目: JByteMod-Beta   文件: AnalyzerAdapter.java

/**
 * Constructs a new {@link AnalyzerAdapter}. <i>Subclasses must not use this constructor</i>.
 * Instead, they must use the {@link #AnalyzerAdapter(int, String, int, String, String,
 * MethodVisitor)} version.
 *
 * @param owner the owner's class name.
 * @param access the method's access flags (see {@link Opcodes}).
 * @param name the method's name.
 * @param descriptor the method's descriptor (see {@link Type}).
 * @param methodVisitor the method visitor to which this adapter delegates calls. May be
 *     <tt>null</tt>.
 * @throws IllegalStateException If a subclass calls this constructor.
 */
public AnalyzerAdapter(
    final String owner,
    final int access,
    final String name,
    final String descriptor,
    final MethodVisitor methodVisitor) {
  this(Opcodes.ASM6, owner, access, name, descriptor, methodVisitor);
  if (getClass() != AnalyzerAdapter.class) {
    throw new IllegalStateException();
  }
}
 
源代码18 项目: JByteMod-Beta   文件: ClassNode.java

/**
 * Constructs a new {@link ClassNode}. <i>Subclasses must not use this
 * constructor</i>. Instead, they must use the {@link #ClassNode(int)}
 * version.
 * 
 * @throws IllegalStateException
 *           If a subclass calls this constructor.
 */
public ClassNode() {
  this(Opcodes.ASM6);
  if (getClass() != ClassNode.class) {
    throw new IllegalStateException();
  }
}
 
源代码19 项目: AVM   文件: ClassInfoVisitor.java

/**
 * Constructs a new class visitor.
 *
 * If {@code isRenamed == true} then we interpret all classes we visit as post-rename classes.
 * Otherwise, we consider them pre-rename classes.
 *
 * Note that this visitor does not perform any renaming at all. It simply creates pre- or post-
 * rename class info objects accordingly.
 */
public ClassInfoVisitor(boolean isRenamed) {
    super(Opcodes.ASM6);
    this.isRenamed = isRenamed;
}
 

/**
 * Constructs a new {@link LocalVariableAnnotationNode}. <i>Subclasses must
 * not use this constructor</i>. Instead, they must use the
 * {@link #LocalVariableAnnotationNode(int, TypePath, LabelNode[], LabelNode[], int[], String)}
 * version.
 * 
 * @param typeRef
 *          a reference to the annotated type. See {@link TypeReference}.
 * @param typePath
 *          the path to the annotated type argument, wildcard bound, array
 *          element type, or static inner type within 'typeRef'. May be
 *          <tt>null</tt> if the annotation targets 'typeRef' as a whole.
 * @param start
 *          the fist instructions corresponding to the continuous ranges that
 *          make the scope of this local variable (inclusive).
 * @param end
 *          the last instructions corresponding to the continuous ranges that
 *          make the scope of this local variable (exclusive). This array must
 *          have the same size as the 'start' array.
 * @param index
 *          the local variable's index in each range. This array must have the
 *          same size as the 'start' array.
 * @param desc
 *          the class descriptor of the annotation class.
 */
public LocalVariableAnnotationNode(int typeRef, TypePath typePath, LabelNode[] start, LabelNode[] end, int[] index, String desc) {
  this(Opcodes.ASM6, typeRef, typePath, start, end, index, desc);
}
 
 方法所在类
 同类方法