當前位置: 首頁>>代碼示例>>Java>>正文


Java Type.LONG_TYPE屬性代碼示例

本文整理匯總了Java中org.objectweb.asm.Type.LONG_TYPE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Type.LONG_TYPE屬性的具體用法?Java Type.LONG_TYPE怎麽用?Java Type.LONG_TYPE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.objectweb.asm.Type的用法示例。


在下文中一共展示了Type.LONG_TYPE屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: opType

private static Type opType(int opcode) {
  switch (opcode) {
    case Opcodes.IADD:
    case Opcodes.ISUB:
    case Opcodes.IMUL:
    case Opcodes.IDIV:
    case Opcodes.IREM:
    case Opcodes.INEG:
    case Opcodes.ISHL:
    case Opcodes.ISHR:
    case Opcodes.IUSHR:
      return Type.INT_TYPE;
    case Opcodes.LADD:
    case Opcodes.LSUB:
    case Opcodes.LMUL:
    case Opcodes.LDIV:
    case Opcodes.LREM:
    case Opcodes.LNEG:
    case Opcodes.LSHL:
    case Opcodes.LSHR:
    case Opcodes.LUSHR:
      return Type.LONG_TYPE;
    case Opcodes.FADD:
    case Opcodes.FSUB:
    case Opcodes.FMUL:
    case Opcodes.FDIV:
    case Opcodes.FREM:
    case Opcodes.FNEG:
      return Type.FLOAT_TYPE;
    case Opcodes.DADD:
    case Opcodes.DSUB:
    case Opcodes.DMUL:
    case Opcodes.DDIV:
    case Opcodes.DREM:
    case Opcodes.DNEG:
      return Type.DOUBLE_TYPE;
    default:
      throw new Unreachable("Unexpected opcode " + opcode);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:40,代碼來源:JarSourceCode.java

示例2: visitVarInsn

@Override
public void visitVarInsn(final int opcode, final int var) {
    Type type;
    switch (opcode) {
    case Opcodes.LLOAD:
    case Opcodes.LSTORE:
        type = Type.LONG_TYPE;
        break;

    case Opcodes.DLOAD:
    case Opcodes.DSTORE:
        type = Type.DOUBLE_TYPE;
        break;

    case Opcodes.FLOAD:
    case Opcodes.FSTORE:
        type = Type.FLOAT_TYPE;
        break;

    case Opcodes.ILOAD:
    case Opcodes.ISTORE:
        type = Type.INT_TYPE;
        break;

    default:
        // case Opcodes.ALOAD:
        // case Opcodes.ASTORE:
        // case RET:
        type = OBJECT_TYPE;
        break;
    }
    mv.visitVarInsn(opcode, remap(var, type));
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:33,代碼來源:LocalVariablesSorter.java

示例3: getArrayElementTypeForOpcode

private static Type getArrayElementTypeForOpcode(int opcode) {
  switch (opcode) {
    case Opcodes.IALOAD:
    case Opcodes.IASTORE:
      return Type.INT_TYPE;
    case Opcodes.FALOAD:
    case Opcodes.FASTORE:
      return Type.FLOAT_TYPE;
    case Opcodes.LALOAD:
    case Opcodes.LASTORE:
      return Type.LONG_TYPE;
    case Opcodes.DALOAD:
    case Opcodes.DASTORE:
      return Type.DOUBLE_TYPE;
    case Opcodes.AALOAD:
    case Opcodes.AASTORE:
      return JarState.NULL_TYPE; // We might not know the type.
    case Opcodes.BALOAD:
    case Opcodes.BASTORE:
      return Type.BYTE_TYPE; // We don't distinguish byte and boolean.
    case Opcodes.CALOAD:
    case Opcodes.CASTORE:
      return Type.CHAR_TYPE;
    case Opcodes.SALOAD:
    case Opcodes.SASTORE:
      return Type.SHORT_TYPE;
    default:
      throw new Unreachable("Unexpected array opcode " + opcode);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:30,代碼來源:JarSourceCode.java

示例4: cast

public void cast(final Type from, final Type to) {
    if (from != to) {
        if (from == Type.DOUBLE_TYPE) {
            if (to == Type.FLOAT_TYPE) {
                mv.visitInsn(Opcodes.D2F);
            } else if (to == Type.LONG_TYPE) {
                mv.visitInsn(Opcodes.D2L);
            } else {
                mv.visitInsn(Opcodes.D2I);
                cast(Type.INT_TYPE, to);
            }
        } else if (from == Type.FLOAT_TYPE) {
            if (to == Type.DOUBLE_TYPE) {
                mv.visitInsn(Opcodes.F2D);
            } else if (to == Type.LONG_TYPE) {
                mv.visitInsn(Opcodes.F2L);
            } else {
                mv.visitInsn(Opcodes.F2I);
                cast(Type.INT_TYPE, to);
            }
        } else if (from == Type.LONG_TYPE) {
            if (to == Type.DOUBLE_TYPE) {
                mv.visitInsn(Opcodes.L2D);
            } else if (to == Type.FLOAT_TYPE) {
                mv.visitInsn(Opcodes.L2F);
            } else {
                mv.visitInsn(Opcodes.L2I);
                cast(Type.INT_TYPE, to);
            }
        } else {
            if (to == Type.BYTE_TYPE) {
                mv.visitInsn(Opcodes.I2B);
            } else if (to == Type.CHAR_TYPE) {
                mv.visitInsn(Opcodes.I2C);
            } else if (to == Type.DOUBLE_TYPE) {
                mv.visitInsn(Opcodes.I2D);
            } else if (to == Type.FLOAT_TYPE) {
                mv.visitInsn(Opcodes.I2F);
            } else if (to == Type.LONG_TYPE) {
                mv.visitInsn(Opcodes.I2L);
            } else if (to == Type.SHORT_TYPE) {
                mv.visitInsn(Opcodes.I2S);
            }
        }
    }
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:46,代碼來源:InstructionAdapter.java

示例5: cast

/**
 * Generates the instructions to cast a numerical value from one type to
 * another.
 * 
 * @param from
 *            the type of the top stack value
 * @param to
 *            the type into which this value must be cast.
 */
public void cast(final Type from, final Type to) {
    if (from != to) {
        if (from == Type.DOUBLE_TYPE) {
            if (to == Type.FLOAT_TYPE) {
                mv.visitInsn(Opcodes.D2F);
            } else if (to == Type.LONG_TYPE) {
                mv.visitInsn(Opcodes.D2L);
            } else {
                mv.visitInsn(Opcodes.D2I);
                cast(Type.INT_TYPE, to);
            }
        } else if (from == Type.FLOAT_TYPE) {
            if (to == Type.DOUBLE_TYPE) {
                mv.visitInsn(Opcodes.F2D);
            } else if (to == Type.LONG_TYPE) {
                mv.visitInsn(Opcodes.F2L);
            } else {
                mv.visitInsn(Opcodes.F2I);
                cast(Type.INT_TYPE, to);
            }
        } else if (from == Type.LONG_TYPE) {
            if (to == Type.DOUBLE_TYPE) {
                mv.visitInsn(Opcodes.L2D);
            } else if (to == Type.FLOAT_TYPE) {
                mv.visitInsn(Opcodes.L2F);
            } else {
                mv.visitInsn(Opcodes.L2I);
                cast(Type.INT_TYPE, to);
            }
        } else {
            if (to == Type.BYTE_TYPE) {
                mv.visitInsn(Opcodes.I2B);
            } else if (to == Type.CHAR_TYPE) {
                mv.visitInsn(Opcodes.I2C);
            } else if (to == Type.DOUBLE_TYPE) {
                mv.visitInsn(Opcodes.I2D);
            } else if (to == Type.FLOAT_TYPE) {
                mv.visitInsn(Opcodes.I2F);
            } else if (to == Type.LONG_TYPE) {
                mv.visitInsn(Opcodes.I2L);
            } else if (to == Type.SHORT_TYPE) {
                mv.visitInsn(Opcodes.I2S);
            }
        }
    }
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:55,代碼來源:GeneratorAdapter.java

示例6: getSize

public int getSize() {
    return type == Type.LONG_TYPE || type == Type.DOUBLE_TYPE ? 2 : 1;
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:3,代碼來源:BasicValue.java

示例7: isCategory1

public static boolean isCategory1(Type type) {
  return type != Type.LONG_TYPE && type != Type.DOUBLE_TYPE;
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:3,代碼來源:JarState.java


注:本文中的org.objectweb.asm.Type.LONG_TYPE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。