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


Java Opcodes.SALOAD屬性代碼示例

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


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

示例1: 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

示例2: isCompatibleArrayElementType

private static boolean isCompatibleArrayElementType(int opcode, Type type) {
  switch (opcode) {
    case Opcodes.IALOAD:
    case Opcodes.IASTORE:
      return Slot.isCompatible(type, Type.INT_TYPE);
    case Opcodes.FALOAD:
    case Opcodes.FASTORE:
      return Slot.isCompatible(type, Type.FLOAT_TYPE);
    case Opcodes.LALOAD:
    case Opcodes.LASTORE:
      return Slot.isCompatible(type, Type.LONG_TYPE);
    case Opcodes.DALOAD:
    case Opcodes.DASTORE:
      return Slot.isCompatible(type, Type.DOUBLE_TYPE);
    case Opcodes.AALOAD:
    case Opcodes.AASTORE:
      return Slot.isCompatible(type, JarState.REFERENCE_TYPE);
    case Opcodes.BALOAD:
    case Opcodes.BASTORE:
      return Slot.isCompatible(type, Type.BYTE_TYPE)
          || Slot.isCompatible(type, Type.BOOLEAN_TYPE);
    case Opcodes.CALOAD:
    case Opcodes.CASTORE:
      return Slot.isCompatible(type, Type.CHAR_TYPE);
    case Opcodes.SALOAD:
    case Opcodes.SASTORE:
      return Slot.isCompatible(type, Type.SHORT_TYPE);
    default:
      throw new Unreachable("Unexpected array opcode " + opcode);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:31,代碼來源:JarSourceCode.java

示例3: 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


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