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


Java Opcodes.INVOKESTATIC属性代码示例

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


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

示例1: doVisitMethodInsn

private void doVisitMethodInsn(int opcode, final String owner,
        final String name, final String desc, final boolean itf) {
    switch (opcode) {
    case Opcodes.INVOKESPECIAL:
        invokespecial(owner, name, desc, itf);
        break;
    case Opcodes.INVOKEVIRTUAL:
        invokevirtual(owner, name, desc, itf);
        break;
    case Opcodes.INVOKESTATIC:
        invokestatic(owner, name, desc, itf);
        break;
    case Opcodes.INVOKEINTERFACE:
        invokeinterface(owner, name, desc);
        break;
    default:
        throw new IllegalArgumentException();
    }
}
 
开发者ID:ItzSomebody,项目名称:DirectLeaks-AntiReleak-Remover,代码行数:19,代码来源:InstructionAdapter.java

示例2: visitMethodInsn

@Override
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
  DexType ownerType = application.getTypeFromName(owner);
  DexMethod method = application.getMethod(ownerType, name, desc);
  switch (opcode) {
    case Opcodes.INVOKEVIRTUAL:
      registry.registerInvokeVirtual(method);
      break;
    case Opcodes.INVOKESTATIC:
      registry.registerInvokeStatic(method);
      break;
    case Opcodes.INVOKEINTERFACE:
      registry.registerInvokeInterface(method);
      break;
    case Opcodes.INVOKESPECIAL:
      if (name.equals(Constants.INSTANCE_INITIALIZER_NAME) || ownerType == clazz) {
        registry.registerInvokeDirect(method);
      } else {
        registry.registerInvokeSuper(method);
      }
      break;
    default:
      throw new Unreachable("Unexpected opcode " + opcode);
  }
}
 
开发者ID:inferjay,项目名称:r8,代码行数:25,代码来源:JarRegisterEffectsVisitor.java

示例3: visit

/**
 * Output call instructions, outputing the correct opcode for the type of
 * call.
 *
 * @param instruction Call instruction.
 * @return            <code>null</code>
 */
@Override
public Void visit(Call instruction) {
  Method    m = instruction.getMethod();
  ClassNode c = m.getOwner();
  
  int opcode;

  switch(instruction.getSort()) {
    case INTERFACE: opcode = Opcodes.INVOKEINTERFACE; break;
    case VIRTUAL:   opcode = Opcodes.INVOKEVIRTUAL;   break;
    case SPECIAL:   opcode = Opcodes.INVOKESPECIAL;   break;
    case STATIC:    opcode = Opcodes.INVOKESTATIC;    break;
    default:        throw new RuntimeException("Unknown call type");
  }

  mv.visitMethodInsn(opcode, c.getName(), m.getName(), m.getDescriptor());
  
  return null;
}
 
开发者ID:adnanmitf09,项目名称:Rubus,代码行数:26,代码来源:InstructionExporter.java

示例4: visitEnd

public void visitEnd() {
	if (exit) {
		done = true;
		Label methodEndLabel = super.mark();
		super.catchException(methodStartLabel,methodEndLabel,Type.getType(RuntimeException.class));
		super.visitMethodInsn(Opcodes.INVOKESTATIC, className, LOG_INTERNAL_STOP_METHOD, LOG_METHOD_SIGNATURE);
		super.visitInsn(Opcodes.ATHROW);
		if (exceptions!=null) {
			for(String ex: exceptions) {
				super.catchException(methodStartLabel,methodEndLabel,Type.getObjectType(ex));
				super.visitMethodInsn(Opcodes.INVOKESTATIC, className, LOG_INTERNAL_STOP_METHOD, LOG_METHOD_SIGNATURE);
				super.visitInsn(Opcodes.ATHROW);
			}
		}
	}
	super.visitEnd();
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:17,代码来源:LogInstrument.java

示例5: onMethodEnter

protected void onMethodEnter() {
	if (done || ! isSynchronized()) return;
	
	has_monitor_operation = true;
	super.visitInsn(Opcodes.ACONST_NULL);
	super.pop();
	methodStartLabel = super.mark();

	super.visitMethodInsn(Opcodes.INVOKESTATIC, className, LOG_INTERNAL_ENTER_METHOD, LOG_CLASS_SIGNATURE);
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:10,代码来源:MonitorInstrument.java

示例6: addLog

private void addLog(boolean dup, int site) {
	if (dup)
		super.visitInsn(Opcodes.DUP);
	super.visitLdcInsn(new Integer(site));
	super.visitMethodInsn(Opcodes.INVOKESTATIC, name,
			LOG_INTERNAL_ALLOC_REPORT, OBJECT_SITE_SIGNATURE);
	if (!constructor)
		super.visitMethodInsn(Opcodes.INVOKESTATIC, name,
				LOG_INTERNAL_ALLOC_DONE, VOID_SIGNATURE);
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:10,代码来源:AllocateInstrument.java

示例7: onMethodEnter

protected void onMethodEnter() {
	if (exit)
		methodStartLabel = super.mark();

	if (!entry) return;
	
	super.visitMethodInsn(Opcodes.INVOKESTATIC, className, LOG_INTERNAL_START_METHOD, LOG_INTERNAL_SIGNATURE);
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:8,代码来源:LogInstrument.java

示例8: visitCode

@Override
public void visitCode() {
	/*
	 * 0  aload_0 [dos]
	 * 1  invokestatic mcheli.multiplay.MCH_MultiplayClient.readImageData(java.io.DataOutputStream) : void [33]
	 * 4  return
	 */
	super.visitVarInsn(Opcodes.ALOAD, 0);
	super.visitMethodInsn(Opcodes.INVOKESTATIC, "net/teamfruit/mchelishield/MCH_MultiplayClient", "readImageData", DescHelper.toDesc(void.class, "java.io.DataOutputStream"), false);
	super.visitInsn(Opcodes.RETURN);
}
 
开发者ID:Team-Fruit,项目名称:McHeliPrivacyShield,代码行数:11,代码来源:MCH_MultiplayClientVisitor.java

示例9: addInc

private void addInc() {
	if (constructor) {
		super.visitMethodInsn(Opcodes.INVOKESTATIC, name,
				LOG_INTERNAL_ALLOC_INC, VOID_SIGNATURE);
		methodStartLabel = super.mark();
	}
	firstInstruction = false;
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:8,代码来源:AllocateInstrument.java

示例10: visitInsn

public void visitInsn(int opcode) {
	if (opcode == Opcodes.MONITORENTER) {
		has_monitor_operation = true;
		super.dup();
		super.visitInsn(opcode);
		super.visitMethodInsn(Opcodes.INVOKESTATIC, className, LOG_INTERNAL_ENTER_METHOD, LOG_OBJECT_SIGNATURE);
	} else if (opcode == Opcodes.MONITOREXIT) {
		has_monitor_operation = true;
		super.dup();
		super.visitMethodInsn(Opcodes.INVOKESTATIC, className, LOG_INTERNAL_EXIT_METHOD, LOG_OBJECT_SIGNATURE);
		super.visitInsn(opcode);
	} else {
		super.visitInsn(opcode);
	}
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:15,代码来源:MonitorInstrument.java

示例11: visitMethodInsn

public void visitMethodInsn(int opcode, String owner, String name, String desc) {
	if (opcode == Opcodes.INVOKEVIRTUAL &&
		JAVA_LANG_OBJECT.equals(owner) &&
		NOTIFY_SIGNATURE.equals(desc) && 
		(NOTIFY_METHOD.equals(name) || NOTIFY_ALL_METHOD.equals(name))) {
		super.dup();
		super.visitMethodInsn(Opcodes.INVOKESTATIC, className, LOG_INTERNAL_NOTIFY_METHOD, LOG_OBJECT_SIGNATURE);
	}
	super.visitMethodInsn(opcode, owner, name, desc);
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:10,代码来源:MonitorInstrument.java

示例12: canThrow

private boolean canThrow(AbstractInsnNode insn) {
  switch (insn.getOpcode()) {
    case Opcodes.AALOAD:
    case Opcodes.AASTORE:
    case Opcodes.ANEWARRAY:
      // ARETURN does not throw in its dex image.
    case Opcodes.ARRAYLENGTH:
    case Opcodes.ATHROW:
    case Opcodes.BALOAD:
    case Opcodes.BASTORE:
    case Opcodes.CALOAD:
    case Opcodes.CASTORE:
    case Opcodes.CHECKCAST:
    case Opcodes.DALOAD:
    case Opcodes.DASTORE:
      // DRETURN does not throw in its dex image.
    case Opcodes.FALOAD:
    case Opcodes.FASTORE:
      // FRETURN does not throw in its dex image.
    case Opcodes.GETFIELD:
    case Opcodes.GETSTATIC:
    case Opcodes.IALOAD:
    case Opcodes.IASTORE:
    case Opcodes.IDIV:
    case Opcodes.INSTANCEOF:
    case Opcodes.INVOKEDYNAMIC:
    case Opcodes.INVOKEINTERFACE:
    case Opcodes.INVOKESPECIAL:
    case Opcodes.INVOKESTATIC:
    case Opcodes.INVOKEVIRTUAL:
    case Opcodes.IREM:
      // IRETURN does not throw in its dex image.
    case Opcodes.LALOAD:
    case Opcodes.LASTORE:
    case Opcodes.LDIV:
    case Opcodes.LREM:
      // LRETURN does not throw in its dex image.
    case Opcodes.MONITORENTER:
    case Opcodes.MONITOREXIT:
    case Opcodes.MULTIANEWARRAY:
    case Opcodes.NEW:
    case Opcodes.NEWARRAY:
    case Opcodes.PUTFIELD:
    case Opcodes.PUTSTATIC:
      // RETURN does not throw in its dex image.
    case Opcodes.SALOAD:
    case Opcodes.SASTORE:
      return true;
    case Opcodes.LDC: {
      // const-class and const-string* may throw in dex.
      LdcInsnNode ldc = (LdcInsnNode) insn;
      return ldc.cst instanceof String || ldc.cst instanceof Type;
    }
    default:
      return false;
  }
}
 
开发者ID:inferjay,项目名称:r8,代码行数:57,代码来源:JarSourceCode.java

示例13: addDec

private void addDec() {
	if (constructor)
		super.visitMethodInsn(Opcodes.INVOKESTATIC, name,
				LOG_INTERNAL_ALLOC_DEC, VOID_SIGNATURE);
}
 
开发者ID:RuiChen08,项目名称:dacapobench,代码行数:5,代码来源:AllocateInstrument.java

示例14: invokeStatic

public static Invocation invokeStatic(BytecodeMethod bytecodeMethod, String owner, String
        name, String desc) {
    return new Invocation(bytecodeMethod.asm(), Opcodes.INVOKESTATIC, new NameSpecification
            (owner), name, new MethodDescriptor(bytecodeMethod.asm().name, desc));
}
 
开发者ID:PizzaCrust,项目名称:Passion,代码行数:5,代码来源:Invocation.java

示例15: getWrapperConstructionInsn

static MethodInsnNode getWrapperConstructionInsn(Type type) {
    char charType = type.getDescriptor().charAt(0);
    String wrapper;
    switch (charType) {
        case 'B':
            wrapper = "java/lang/Byte";
            break;
        case 'C':
            wrapper = "java/lang/Character";
            break;
        case 'D':
            wrapper = "java/lang/Double";
            break;
        case 'F':
            wrapper = "java/lang/Float";
            break;
        case 'I':
            wrapper = "java/lang/Integer";
            break;
        case 'J':
            wrapper = "java/lang/Long";
            break;
        case 'L':
            return null;
        case '[':
            return null;
        case 'Z':
            wrapper = "java/lang/Boolean";
            break;
        case 'S':
            wrapper = "java/lang/Short";
            break;
        default:
            throw new ClassFormatError("Invalid method signature: "
                    + type.getDescriptor());
    }

    return new MethodInsnNode(Opcodes.INVOKESTATIC, wrapper, "valueOf",
            "(" + charType + ")L" + wrapper + ";", false);

}
 
开发者ID:yutian-tianpl,项目名称:byte-cobweb,代码行数:41,代码来源:TreeInsn.java


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