当前位置: 首页>>代码示例>>Java>>正文


Java JSRInlinerAdapter类代码示例

本文整理汇总了Java中org.objectweb.asm.commons.JSRInlinerAdapter的典型用法代码示例。如果您正苦于以下问题:Java JSRInlinerAdapter类的具体用法?Java JSRInlinerAdapter怎么用?Java JSRInlinerAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JSRInlinerAdapter类属于org.objectweb.asm.commons包,在下文中一共展示了JSRInlinerAdapter类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadClass

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
public static ClassNode loadClass(InputStream is, int mode) {
	try {
		final ClassReader reader = new ClassReader(is);
		final ClassNode node = new ClassNode();

		reader.accept(node, mode);
		for(int i = 0; i < node.methods.size(); ++i) {
			final MethodNode methodNode2 = (MethodNode) node.methods.get(i);
			final JSRInlinerAdapter adapter = new JSRInlinerAdapter(methodNode2, methodNode2.access, methodNode2.name, methodNode2.desc, methodNode2.signature, (String[]) methodNode2.exceptions.toArray(new String[0]));
			methodNode2.accept(adapter);
			node.methods.set(i, adapter);
		}

		Main.getInstance().nameToNode.put(node.name, node);
		Main.getInstance().nodeToName.put(node, node.name);

		return node;
	} catch(Throwable t) {
		t.printStackTrace();
		return null;
	}
}
 
开发者ID:MoofMonkey,项目名称:NeonObf,代码行数:23,代码来源:CustomClassWriter.java

示例2: visitMethod

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
/**
 * For each method in the class being instrumented, <code>visitMethod</code>
 * is called and the returned MethodVisitor is used to visit the method.
 * Note that a new MethodVisitor is constructed for each method.
 */
@Override
public MethodVisitor visitMethod(int access, String base, String desc,
    String signature, String[] exceptions) {
  MethodVisitor mv =
    cv.visitMethod(access, base, desc, signature, exceptions);

  if (mv != null) {
    // We need to compute stackmaps (see
    // AllocationInstrumenter#instrument).  This can't really be
    // done for old bytecode that contains JSR and RET instructions.
    // So, we remove JSRs and RETs.
    JSRInlinerAdapter jsria = new JSRInlinerAdapter(
        mv, access, base, desc, signature, exceptions);
    AllocationMethodAdapter aimv =
      new AllocationMethodAdapter(jsria, recorderClass, recorderMethod);
    LocalVariablesSorter lvs = new LocalVariablesSorter(access, desc, aimv);
    aimv.lvs = lvs;
    mv = lvs;
  }
  return mv;
}
 
开发者ID:google,项目名称:allocation-instrumenter,代码行数:27,代码来源:AllocationClassAdapter.java

示例3: visitMethod

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature,
    String[] exceptions) {
  MethodNode node = new JSRInlinerAdapter(null, access, name, desc, signature, exceptions);
  JarCode code = context.lookupMap.get(application.getMethod(context.owner.type, name, desc));
  if (code != null) {
    code.context = null;
    code.node = node;
    return node;
  }
  return null;
}
 
开发者ID:inferjay,项目名称:r8,代码行数:13,代码来源:JarCode.java

示例4: useJSRInlinerAdapter

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
private static ClassVisitor useJSRInlinerAdapter(ClassVisitor visitor)
{
    return new ClassVisitor(Opcodes.ASM5, visitor)
    {
        @Override
        public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
        {
            return new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions);
        }
    };
}
 
开发者ID:geekflow,项目名称:light,代码行数:12,代码来源:ASMUtil.java

示例5: fixJSRInlining

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
static byte[] fixJSRInlining(byte[] byteCode) {
	ClassReader reader = new ClassReader(byteCode);
	ClassWriter writer = new FixedClassWriter(reader, 0);
	
	ClassVisitor visitor = new ClassVisitor(Opcodes.ASM5, writer) {
		@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
			return new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions);
		}
	};
	
	reader.accept(visitor, 0);
	return writer.toByteArray();
}
 
开发者ID:git03394538,项目名称:lombok-ianchiu,代码行数:14,代码来源:AsmUtil.java

示例6: visitAllowedMethod

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
@Override
public MethodVisitor visitAllowedMethod(MethodVisitor mv, int access, String name, String desc, String signature, String[] exceptions) {
    List<Metric> metadata = config.findMetrics(className, name, desc);

    mv = new MetricAdapter(mv, className, access, name, desc, metadata);
    return new JSRInlinerAdapter(mv, access, name, desc, signature, exceptions);
}
 
开发者ID:willfleury,项目名称:metrics-agent,代码行数:8,代码来源:MetricClassVisitor.java

示例7: visitMethod

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
    BytecodeMethod mtd = new BytecodeMethod(clsName, access, name, desc, signature, exceptions);
    cls.addMethod(mtd);
    JSRInlinerAdapter a = new JSRInlinerAdapter(new MethodVisitorWrapper(super.visitMethod(access, name, desc, signature, exceptions), mtd), access, name, desc, signature, exceptions);
    return a; 
}
 
开发者ID:codenameone,项目名称:CodenameOne,代码行数:8,代码来源:Parser.java

示例8: toMethodVisitor

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
/**
 * helper method for method visitor generation
 * @param access
 * @param method
 * @param cv
 * @return
 */
private static MethodVisitor toMethodVisitor(int access, Method method, ClassVisitor cv) {
	MethodVisitor visitor = 
			cv.visitMethod(access, method.getName(), method.getDescriptor(), null, null);
	JSRInlinerAdapter inlinerAdapter = 
			new JSRInlinerAdapter(visitor, access, method.getName(), method.getDescriptor(), null, null);
	return inlinerAdapter;
}
 
开发者ID:peg4d,项目名称:peg4d-java,代码行数:15,代码来源:ClassBuilder.java

示例9: visitMethod

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
@Override
public MethodVisitor visitMethod(int access, String name, String desc,
        @Nullable String signature, String /*@Nullable*/ [] exceptions) {
    MethodVisitor mv =
            checkNotNull(cv).visitMethod(access, name, desc, signature, exceptions);
    return new JSRInlinerAdapter(mv, access, name, desc, signature, exceptions);
}
 
开发者ID:glowroot,项目名称:glowroot,代码行数:8,代码来源:Weaver.java

示例10: fixJSRInlining

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
static byte[] fixJSRInlining(byte[] byteCode) {
	ClassReader reader = new ClassReader(byteCode);
	ClassWriter writer = new FixedClassWriter(reader, 0);
	
	ClassVisitor visitor = new ClassVisitor(Opcodes.ASM4, writer) {
		@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
			return new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions);
		}
	};
	
	reader.accept(visitor, 0);
	return writer.toByteArray();
}
 
开发者ID:redundent,项目名称:lombok,代码行数:14,代码来源:AsmUtil.java

示例11: visitMethod

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
@Override
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
    MethodVisitor origVisitor = super.visitMethod(access, name, desc, signature, exceptions);
    return new JSRInlinerAdapter(origVisitor, access, name, desc, signature, exceptions);
}
 
开发者ID:offbynull,项目名称:coroutines,代码行数:6,代码来源:SimpleClassNode.java

示例12: visitMethod

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
	return new JSRInlinerAdapter(super.visitMethod(access, name, desc, signature, exceptions), access, name, desc, signature, exceptions); 
}
 
开发者ID:jopereira,项目名称:minha,代码行数:4,代码来源:JSRInlinerClassVisitor.java

示例13: visitMethod

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
@Override
public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) {
    final MethodVisitor visitor = super.visitMethod(access, name, desc, signature, exceptions);
    return visitor == null ? null : new JSRInlinerAdapter(visitor, access, name, desc, signature, exceptions);
}
 
开发者ID:hammacher,项目名称:javaslicer,代码行数:6,代码来源:JSRInliner.java

示例14: toMethodVisitor

import org.objectweb.asm.commons.JSRInlinerAdapter; //导入依赖的package包/类
/**
 * helper method for method visitor generation
 * 
 * @param access
 * @param method
 * @param cv
 * @return
 */

private static MethodVisitor toMethodVisitor(int access, Method method, ClassVisitor cv) {
	MethodVisitor visitor = cv.visitMethod(access, method.getName(), method.getDescriptor(), null, null);
	JSRInlinerAdapter inlinerAdapter = new JSRInlinerAdapter(visitor, access, method.getName(), method.getDescriptor(), null, null);
	return inlinerAdapter;
	// return visitor;
}
 
开发者ID:nez-peg,项目名称:konoha,代码行数:16,代码来源:MethodBuilder.java


注:本文中的org.objectweb.asm.commons.JSRInlinerAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。