org.objectweb.asm.tree.AbstractInsnNode.getOpcode()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(30)

本文整理了Java中org.objectweb.asm.tree.AbstractInsnNode.getOpcode()方法的一些代码示例,展示了AbstractInsnNode.getOpcode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractInsnNode.getOpcode()方法的具体详情如下:
包路径:org.objectweb.asm.tree.AbstractInsnNode
类名称:AbstractInsnNode
方法名:getOpcode

AbstractInsnNode.getOpcode介绍

[英]Returns the opcode of this instruction.
[中]返回此指令的操作码。

代码示例

代码示例来源:origin: jooby-project/jooby

public static <T extends AbstractInsnNode> Predicate<T> opcode(final int opcode) {
 return it -> it.getOpcode() == opcode;
}

代码示例来源:origin: pxb1988/dex2jar

Object readCst(AbstractInsnNode q) {
  switch (q.getOpcode()) {
    case Opcodes.LDC:
    case Opcodes.ICONST_5:
      return q.getOpcode() - Opcodes.ICONST_0;
    case Opcodes.LCONST_0:
    case Opcodes.LCONST_1:
      return (long) (q.getOpcode() - Opcodes.LCONST_0);
    case Opcodes.FCONST_0:
    case Opcodes.FCONST_1:
    case Opcodes.FCONST_2:
      return (float) (q.getOpcode() - Opcodes.FCONST_0);
    case Opcodes.DCONST_0:
    case Opcodes.DCONST_1:
      return (double) (q.getOpcode() - Opcodes.DCONST_0);
    case Opcodes.ACONST_NULL:
      return null;

代码示例来源:origin: kilim/kilim

public boolean isGetCurrentTask() {
  AbstractInsnNode ain = getInstruction(startPos);
  if (ain.getOpcode() == INVOKESTATIC) {
    MethodInsnNode min = (MethodInsnNode)ain;
    return min.owner.equals(TASK_CLASS) && min.name.equals("getCurrentTask");
  }
  return false;
}

代码示例来源:origin: kilim/kilim

int lastInstruction() {
  AbstractInsnNode ainode = getInstruction(endPos);
  return ainode.getOpcode();
}

代码示例来源:origin: pxb1988/dex2jar

@Override
  public void execute(AbstractInsnNode insn, Interpreter<JvmValue> interpreter) throws AnalyzerException {
    if (insn.getType() == AbstractInsnNode.FRAME || insn.getType() == AbstractInsnNode.LINE || insn.getType() == AbstractInsnNode.LABEL) {
      return;
    }
    if (insn.getOpcode() == Opcodes.RETURN) {
      interpreter.returnOperation(insn, null, null);
    } else if (insn.getOpcode() == Opcodes.GOTO) {
      interpreter.unaryOperation(insn, null);
    } else if (insn.getOpcode() == RET) {
      throw new RuntimeException("not support yet!");
    } else {
      super.execute(insn, interpreter);
    }
  }
}

代码示例来源:origin: linkedin/parseq

private int findMethodCall(InsnList insns, LabelNode label) {
 boolean foundLabel = false;
 for (int i = 0; i < insns.size(); i++) {
  AbstractInsnNode n = insns.get(i);
  if (!foundLabel && n == label) {
   foundLabel = true;
  } else if (foundLabel && n.getOpcode() == Opcodes.INVOKEDYNAMIC) {
   return i;
  }
 }
 return -1;
}

代码示例来源:origin: linkedin/parseq

static String getDescriptionForTypeInsnNode(TypeInsnNode typeInsnNode) {
  AbstractInsnNode nextInsn = typeInsnNode.getNext();
  StringJoiner argsDesc = new StringJoiner(",", "(", ")");
  while (nextInsn != null) {
   if (nextInsn instanceof LdcInsnNode) {
    argsDesc.add("_");
   } else if (nextInsn.getOpcode() == Opcodes.DUP) {
    //ignore
   } else {
    break;
   }
   nextInsn = nextInsn.getNext();
  }
  if (typeInsnNode.getOpcode() == Opcodes.NEW) {
   return "new " + Util.extractSimpleName(typeInsnNode.desc, "/") + argsDesc.toString();
  }

  return "";
 }
}

代码示例来源:origin: pxb1988/dex2jar

if (p.getOpcode() == Opcodes.INVOKESTATIC) {
  MethodInsnNode mn = (MethodInsnNode) p;
  key.owner = mn.owner;

代码示例来源:origin: kilim/kilim

void changeJSR_RET_toGOTOs() throws KilimException {
  int lastInsn = getInstruction(endPos).getOpcode(); 
  if (lastInsn == JSR) {
    BasicBlock targetBB = successors.get(0);
    if (!targetBB.hasFlag(PAUSABLE_SUB)) return;
    changeLastInsnToGOTO(targetBB.startLabel);
    successors.clear();
    successors.add(targetBB);
    // change the first ASTORE instruction in targetBB to a NOP
    assert targetBB.getInstruction(targetBB.startPos).getOpcode() == ASTORE;
    targetBB.setInstruction(targetBB.startPos, new NopInsn());
    targetBB.unsetFlag(IS_SUBROUTINE);
  } else if (lastInsn == RET && hasFlag(PAUSABLE_SUB)) {
    changeLastInsnToGOTO(successors.get(0).startLabel);
  }
}

代码示例来源:origin: pxb1988/dex2jar

values[i] = getLocal(xvalues.get(i));
if (insn.getOpcode() == MULTIANEWARRAY) {
  throw new UnsupportedOperationException("Not supported yet.");
} else {
  String owner = "L" + mi.owner + ";";
  String ps[] = toDescArray(Type.getArgumentTypes(mi.desc));
  switch (insn.getOpcode()) {
    case INVOKEVIRTUAL:
      v = Exprs.nInvokeVirtual(values, owner, mi.name, ps, ret);

代码示例来源:origin: Sable/soot

void setUnit(AbstractInsnNode insn, Unit u) {
 if (Options.v().keep_line_number() && lastLineNumber >= 0) {
  Tag lineTag = u.getTag("LineNumberTag");
  if (lineTag == null) {
   lineTag = new LineNumberTag(lastLineNumber);
   u.addTag(lineTag);
  } else if (((LineNumberTag) lineTag).getLineNumber() != lastLineNumber) {
   throw new RuntimeException("Line tag mismatch");
  }
 }
 Unit o = units.put(insn, u);
 if (o != null) {
  throw new AssertionError(insn.getOpcode() + " already has a unit, " + o);
 }
}

代码示例来源:origin: robolectric/robolectric

AbstractInsnNode node = insns[i];
switch (node.getOpcode()) {
 case Opcodes.ALOAD:
  VarInsnNode vnode = (VarInsnNode) node;

代码示例来源:origin: pxb1988/dex2jar

if (p.getOpcode() == Opcodes.INVOKESTATIC) {
  MethodInsnNode mn = (MethodInsnNode) p;
  key.owner = mn.owner;

代码示例来源:origin: pxb1988/dex2jar

@Override
  public void returnOperation(AbstractInsnNode insn, JvmValue value, JvmValue expected) throws AnalyzerException {
    switch (insn.getOpcode()) {
      case IRETURN:
      case LRETURN:
      case FRETURN:
      case DRETURN:
      case ARETURN:
        emit(Stmts.nReturn(getLocal(value)));
        break;
      case RETURN:
        emit(Stmts.nReturnVoid());
        break;
    }
  }
};

代码示例来源:origin: pxb1988/dex2jar

@Override
public JvmValue newOperation(AbstractInsnNode insn) throws AnalyzerException {
  switch (insn.getOpcode()) {
    case ACONST_NULL:
      return b(1, Exprs.nNull());
    case ICONST_4:
    case ICONST_5:
      return b(1, Exprs.nInt(insn.getOpcode() - ICONST_0));
    case LCONST_0:
    case LCONST_1:
      return b(2, Exprs.nLong(insn.getOpcode() - LCONST_0));
    case FCONST_0:
    case FCONST_1:
    case FCONST_2:
      return b(1, Exprs.nFloat(insn.getOpcode() - FCONST_0));
    case DCONST_0:
    case DCONST_1:
      return b(2, Exprs.nDouble(insn.getOpcode() - DCONST_0));
    case BIPUSH:
    case SIPUSH:

代码示例来源:origin: robolectric/robolectric

AbstractInsnNode node = instructions.next();
switch (node.getOpcode()) {
 case Opcodes.NEW:
  TypeInsnNode newInsnNode = (TypeInsnNode) node;

代码示例来源:origin: pxb1988/dex2jar

tmp.execute(p, interpreter);
int op = p.getOpcode();
if (p.getType() == AbstractInsnNode.JUMP_INSN) {
  JumpInsnNode jump = (JumpInsnNode) p;

代码示例来源:origin: Sable/soot

int op = opr.insn.getOpcode();
if (l == null && op != GETFIELD && op != GETSTATIC && (op < IALOAD && op > SALOAD)) {
 continue;

代码示例来源:origin: pxb1988/dex2jar

parentCount[insnList.indexOf(jump.label)]++;
int op = p.getOpcode();
if (op == Opcodes.TABLESWITCH || op == Opcodes.LOOKUPSWITCH) {
  if (op == Opcodes.TABLESWITCH) {

代码示例来源:origin: pxb1988/dex2jar

Local local2 = getLocal(value2);
Local local3 = getLocal(value3);
switch (insn.getOpcode()) {
  case IASTORE:
    emit(Stmts.nAssign(Exprs.nArray(local1, local2, "I"),

相关文章