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


Java AbstractInsnNode.getType方法代码示例

本文整理汇总了Java中org.objectweb.asm.tree.AbstractInsnNode.getType方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractInsnNode.getType方法的具体用法?Java AbstractInsnNode.getType怎么用?Java AbstractInsnNode.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.objectweb.asm.tree.AbstractInsnNode的用法示例。


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

示例1: addDirectExits

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
private static void addDirectExits(InsnList il, BitSet entryPoints, Map<AbstractInsnNode, int[]> exitPoints) {
	int idx = 0; // ignore 0 since it has no preceding instruction

	while ((idx = entryPoints.nextSetBit(idx + 1)) != -1) {
		AbstractInsnNode prev = il.get(idx - 1);
		if (exitPoints.containsKey(prev)) continue;
		int type = prev.getType();

		if (prev.getOpcode() != Opcodes.ATHROW
				&& (prev.getOpcode() < Opcodes.IRETURN || prev.getOpcode() > Opcodes.RETURN)
				&& type != AbstractInsnNode.JUMP_INSN
				&& type != AbstractInsnNode.TABLESWITCH_INSN
				&& type != AbstractInsnNode.LOOKUPSWITCH_INSN) {
			exitPoints.put(prev, new int[] { idx });
		}
	}
}
 
开发者ID:sfPlayer1,项目名称:Matcher,代码行数:18,代码来源:Analysis.java

示例2: findID

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
private static void findID(ClassNode classNode) throws Throwable {
    for (MethodNode methodNode : classNode.methods) {
        Iterator<AbstractInsnNode> insnIterator = methodNode.instructions.iterator();
        while (insnIterator.hasNext()) {
            AbstractInsnNode insnNode = insnIterator.next();
            String str;
            if ((insnNode.getType() == 9)) {
                Object cst = ((LdcInsnNode) insnNode).cst;
                if (cst instanceof String) {
                    str = ((LdcInsnNode) insnNode).cst.toString();
                    Matcher matcher = NONCEID_PATTERN.matcher(str);
                    if (matcher.find()) {
                        possiblenonces.add(str);
                    }
                }
            }
        }
    }
}
 
开发者ID:ItzSomebody,项目名称:Spigot-Nonce-ID-Finder,代码行数:20,代码来源:Finder.java

示例3: populateClassGraph

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
public void populateClassGraph() {
  String className = Type.getObjectType(classNode.name).getClassName();
  logger.debug("Creating graph for class {}" , className);
  for (MethodNode methodNode : classNode.methods) {
    String methodName = methodNode.name;
    MethodGraph caller = new MethodGraph(className, methodName);
    InsnList instructions = methodNode.instructions;
    for (int i = 0; i < instructions.size(); i++) {
      AbstractInsnNode insnNode = instructions.get(i);
      if (insnNode.getType() == AbstractInsnNode.METHOD_INSN) {
        MethodInsnNode methodInsnNode = (MethodInsnNode)insnNode;
        String calledOwner = Type.getObjectType(methodInsnNode.owner).getClassName();
        String calledName = methodInsnNode.name;
        MethodGraph called = new MethodGraph(calledOwner, calledName);
        Call call = new Call(caller, called);
        if (!called.getOwner().equals("java.lang.Object") && !called.getName().equals("<init>")) {
          logger.trace("Adding call graph: {}", call.toString());
          GraphHolder.addCallGraph(call);
        }
      }
    }
  }
}
 
开发者ID:fergarrui,项目名称:custom-bytecode-analyzer,代码行数:24,代码来源:ClassCallGraph.java

示例4: process

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
@Override
public void process() {
  for (MethodNode methodNode : getClassNode().methods) {
    InsnList instructions = methodNode.instructions;
    for (int i = 0; i < instructions.size(); i++) {
      AbstractInsnNode insnNode = instructions.get(i);
      if (insnNode.getType() == AbstractInsnNode.METHOD_INSN) {
        MethodInsnNode methodInsnNode = (MethodInsnNode)insnNode;
        processMethodInsnNode(methodNode, methodInsnNode);
      }
    }
  }
}
 
开发者ID:fergarrui,项目名称:custom-bytecode-analyzer,代码行数:14,代码来源:CustomMethodInvocationVisitor.java

示例5: populate

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
private void populate(InsnList opcodes) {
	int selected = -1, labelCount = 0;;
	DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
	for (int i = 0; i < opcodes.size(); i++) {
		AbstractInsnNode ain = opcodes.get(i);
		if (ain.getType() == AbstractInsnNode.LABEL) {
			LabelNode label = (LabelNode) ain;
			String s = i + ".";
			if (list != null) {
				s += " : " + list.getLabelName(ain);
			}
			labels.put(s, label);
			model.addElement(s);
			if (label.equals(initial)) {
				selected = labelCount;
			}
			labelCount++;
		}
	}
	combo.setModel(model);
	combo.setSelectedIndex(selected);
	combo.addItemListener(new ItemListener() {
		@Override
		public void itemStateChanged(ItemEvent e) {
			updater.accept(labels.get(e.getItem()));
			if (list != null) {
				list.repaint();
			}
		}
	});
}
 
开发者ID:Col-E,项目名称:Recaf,代码行数:32,代码来源:LabelSwitcherPanel.java

示例6: updateState

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
private void updateState(AbstractInsnNode insn) {
  switch (insn.getType()) {
    case AbstractInsnNode.INSN:
      updateState((InsnNode) insn);
      break;
    case AbstractInsnNode.INT_INSN:
      updateState((IntInsnNode) insn);
      break;
    case AbstractInsnNode.VAR_INSN:
      updateState((VarInsnNode) insn);
      break;
    case AbstractInsnNode.TYPE_INSN:
      updateState((TypeInsnNode) insn);
      break;
    case AbstractInsnNode.FIELD_INSN:
      updateState((FieldInsnNode) insn);
      break;
    case AbstractInsnNode.METHOD_INSN:
      updateState((MethodInsnNode) insn);
      break;
    case AbstractInsnNode.INVOKE_DYNAMIC_INSN:
      updateState((InvokeDynamicInsnNode) insn);
      break;
    case AbstractInsnNode.JUMP_INSN:
      updateState((JumpInsnNode) insn);
      break;
    case AbstractInsnNode.LABEL:
      updateState((LabelNode) insn);
      break;
    case AbstractInsnNode.LDC_INSN:
      updateState((LdcInsnNode) insn);
      break;
    case AbstractInsnNode.IINC_INSN:
      updateState((IincInsnNode) insn);
      break;
    case AbstractInsnNode.TABLESWITCH_INSN:
      updateState((TableSwitchInsnNode) insn);
      break;
    case AbstractInsnNode.LOOKUPSWITCH_INSN:
      updateState((LookupSwitchInsnNode) insn);
      break;
    case AbstractInsnNode.MULTIANEWARRAY_INSN:
      updateState((MultiANewArrayInsnNode) insn);
      break;
    case AbstractInsnNode.LINE:
      updateState((LineNumberNode) insn);
      break;
    default:
      throw new Unreachable("Unexpected instruction " + insn);
  }
}
 
开发者ID:inferjay,项目名称:r8,代码行数:52,代码来源:JarSourceCode.java

示例7: build

import org.objectweb.asm.tree.AbstractInsnNode; //导入方法依赖的package包/类
private void build(AbstractInsnNode insn, IRBuilder builder) {
  switch (insn.getType()) {
    case AbstractInsnNode.INSN:
      build((InsnNode) insn, builder);
      break;
    case AbstractInsnNode.INT_INSN:
      build((IntInsnNode) insn, builder);
      break;
    case AbstractInsnNode.VAR_INSN:
      build((VarInsnNode) insn, builder);
      break;
    case AbstractInsnNode.TYPE_INSN:
      build((TypeInsnNode) insn, builder);
      break;
    case AbstractInsnNode.FIELD_INSN:
      build((FieldInsnNode) insn, builder);
      break;
    case AbstractInsnNode.METHOD_INSN:
      build((MethodInsnNode) insn, builder);
      break;
    case AbstractInsnNode.INVOKE_DYNAMIC_INSN:
      build((InvokeDynamicInsnNode) insn, builder);
      break;
    case AbstractInsnNode.JUMP_INSN:
      build((JumpInsnNode) insn, builder);
      break;
    case AbstractInsnNode.LABEL:
      build((LabelNode) insn, builder);
      break;
    case AbstractInsnNode.LDC_INSN:
      build((LdcInsnNode) insn, builder);
      break;
    case AbstractInsnNode.IINC_INSN:
      build((IincInsnNode) insn, builder);
      break;
    case AbstractInsnNode.TABLESWITCH_INSN:
      build((TableSwitchInsnNode) insn, builder);
      break;
    case AbstractInsnNode.LOOKUPSWITCH_INSN:
      build((LookupSwitchInsnNode) insn, builder);
      break;
    case AbstractInsnNode.MULTIANEWARRAY_INSN:
      build((MultiANewArrayInsnNode) insn, builder);
      break;
    case AbstractInsnNode.LINE:
      build((LineNumberNode) insn, builder);
      break;
    default:
      throw new Unreachable("Unexpected instruction " + insn);
  }
}
 
开发者ID:inferjay,项目名称:r8,代码行数:52,代码来源:JarSourceCode.java


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