org.objectweb.asm.Opcodes# LNEG 源码实例Demo

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

源代码1 项目: es6draft   文件: InstructionAssembler.java

public final void neg(Type type) {
    switch (type.getOpcode(Opcodes.INEG)) {
    case Opcodes.INEG:
        ineg();
        return;
    case Opcodes.LNEG:
        lneg();
        return;
    case Opcodes.FNEG:
        fneg();
        return;
    case Opcodes.DNEG:
        dneg();
        return;
    default:
        throw new IllegalArgumentException();
    }
}
 
源代码2 项目: maple-ir   文件: TypeUtils.java

public static int getNegateOpcode(Type type) {
	if (type == Type.INT_TYPE || type == Type.SHORT_TYPE || type == Type.BYTE_TYPE) {
		return Opcodes.INEG;
	} else if (type == Type.LONG_TYPE) {
		return Opcodes.LNEG;
	} else if (type == Type.FLOAT_TYPE) {
		return Opcodes.FNEG;
	} else if (type == Type.DOUBLE_TYPE) {
		return Opcodes.DNEG;
	} else {
		throw new IllegalArgumentException(type.toString());
	}
}
 
源代码3 项目: zelixkiller   文件: StackHelper.java

public InsnValue invertValue(AbstractInsnNode insn, InsnValue value) {
	Object obj = value.getValue();
	switch (insn.getOpcode()) {
	case Opcodes.INEG:
		if (obj == null) {
			return InsnValue.INT_VALUE;
		}
		return InsnValue.intValue(-1 * (int) obj);
	case Opcodes.LNEG:
		if (obj == null) {
			return InsnValue.LONG_VALUE;
		}
		return InsnValue.longValue(-1L * (long) obj);
	case Opcodes.FNEG:
		if (obj == null) {
			return InsnValue.FLOAT_VALUE;
		}
		return InsnValue.floatValue(-1F * (float) obj);
	case Opcodes.DNEG:
		if (obj == null) {
			return InsnValue.DOUBLE_VALUE;
		}
		return InsnValue.doubleValue(-1D * (double) obj);
	}

	return null;
}
 
 方法所在类
 同类方法