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


Java Type.VOID屬性代碼示例

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


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

示例1: moveType

private static MoveType moveType(Type type) {
  switch (type.getSort()) {
    case Type.ARRAY:
    case Type.OBJECT:
      return MoveType.OBJECT;
    case Type.BOOLEAN:
    case Type.BYTE:
    case Type.SHORT:
    case Type.CHAR:
    case Type.INT:
    case Type.FLOAT:
      return MoveType.SINGLE;
    case Type.LONG:
    case Type.DOUBLE:
      return MoveType.WIDE;
    case Type.VOID:
      // Illegal. Throws in fallthrough.
    default:
      throw new Unreachable("Invalid type in moveType: " + type);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:21,代碼來源:JarSourceCode.java

示例2: constType

private static ConstType constType(Type type) {
  switch (type.getSort()) {
    case Type.ARRAY:
    case Type.OBJECT:
      return ConstType.OBJECT;
    case Type.BOOLEAN:
    case Type.BYTE:
    case Type.SHORT:
    case Type.CHAR:
    case Type.INT:
      return ConstType.INT;
    case Type.FLOAT:
      return ConstType.FLOAT;
    case Type.LONG:
      return ConstType.LONG;
    case Type.DOUBLE:
      return ConstType.DOUBLE;
    case Type.VOID:
      // Illegal. Throws in fallthrough.
    default:
      throw new Unreachable("Invalid type in constType: " + type);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:23,代碼來源:JarSourceCode.java

示例3: memberType

private static MemberType memberType(Type type) {
  switch (type.getSort()) {
    case Type.ARRAY:
    case Type.OBJECT:
      return MemberType.OBJECT;
    case Type.BOOLEAN:
      return MemberType.BOOLEAN;
    case Type.BYTE:
      return MemberType.BYTE;
    case Type.SHORT:
      return MemberType.SHORT;
    case Type.CHAR:
      return MemberType.CHAR;
    case Type.INT:
    case Type.FLOAT:
      return MemberType.SINGLE;
    case Type.LONG:
    case Type.DOUBLE:
      return MemberType.WIDE;
    case Type.VOID:
      // Illegal. Throws in fallthrough.
    default:
      throw new Unreachable("Invalid type in memberType: " + type);
  }
}
 
開發者ID:inferjay,項目名稱:r8,代碼行數:25,代碼來源:JarSourceCode.java

示例4: generateDefaultTraceAfter

private static void generateDefaultTraceAfter(InterceptedCall call, MethodVisitor mv, int mcvar, Type retType, MethodInfo minfo) {
    if (retType.getSort() == Type.VOID) {
        // Do nothing
    } else if (retType.getSort() == Type.ARRAY || retType.getSort() == Type.OBJECT) {
        mv.visitVarInsn(ALOAD, mcvar);
        mv.visitMethodInsn(INVOKESTATIC, RT_InternalName, "returnValue", "(Ljava/lang/Object;" + MethodCall_Desc + ")Ljava/lang/Object;", false);
        if (!"java/lang/Object".equals(retType.getInternalName()))
            mv.visitTypeInsn(CHECKCAST, retType.getInternalName());
    } else {
        mv.visitVarInsn(ALOAD, mcvar);
        String returnNativeType = minfo.returnNativeType;
        if ("GLenum".equals(returnNativeType) || "GLboolean".equals(returnNativeType)) {
            loadGLenumReturn(call.glName, "glEnumReturn", mv);
        } else if ("GLFWwindow *".equals(returnNativeType)) {
            mv.visitMethodInsn(INVOKESTATIC, RT_InternalName, "returnValueGlfwWindow", "(" + retType.getDescriptor() + MethodCall_Desc + ")" + retType.getDescriptor(), false);
        } else if ("GLFWmonitor *".equals(returnNativeType)) {
            mv.visitMethodInsn(INVOKESTATIC, RT_InternalName, "returnValueGlfwMonitor", "(" + retType.getDescriptor() + MethodCall_Desc + ")" + retType.getDescriptor(), false);
        } else {
            mv.visitMethodInsn(INVOKESTATIC, RT_InternalName, "returnValue", "(" + retType.getDescriptor() + MethodCall_Desc + ")" + retType.getDescriptor(), false);
        }
    }
    mv.visitVarInsn(ALOAD, mcvar);
    mv.visitMethodInsn(INVOKESTATIC, RT_InternalName, "methodCall", "(Lorg/lwjglx/debug/MethodCall;)V", false);
}
 
開發者ID:LWJGLX,項目名稱:debug,代碼行數:24,代碼來源:InterceptClassGenerator.java

示例5: unbox

/**
 * Generates the instructions to unbox the top stack value. This value is
 * replaced by its unboxed equivalent on top of the stack.
 * 
 * @param type
 *            the type of the top stack value.
 */
public void unbox(final Type type) {
    Type t = NUMBER_TYPE;
    Method sig = null;
    switch (type.getSort()) {
    case Type.VOID:
        return;
    case Type.CHAR:
        t = CHARACTER_TYPE;
        sig = CHAR_VALUE;
        break;
    case Type.BOOLEAN:
        t = BOOLEAN_TYPE;
        sig = BOOLEAN_VALUE;
        break;
    case Type.DOUBLE:
        sig = DOUBLE_VALUE;
        break;
    case Type.FLOAT:
        sig = FLOAT_VALUE;
        break;
    case Type.LONG:
        sig = LONG_VALUE;
        break;
    case Type.INT:
    case Type.SHORT:
    case Type.BYTE:
        sig = INT_VALUE;
    }
    if (sig == null) {
        checkCast(type);
    } else {
        checkCast(t);
        invokeVirtual(t, sig);
    }
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:42,代碼來源:GeneratorAdapter.java

示例6: newValue

@Override
public BasicValue newValue(final Type type) {
    if (type == null) {
        return BasicValue.UNINITIALIZED_VALUE;
    }
    switch (type.getSort()) {
    case Type.VOID:
        return null;
    case Type.BOOLEAN:
    case Type.CHAR:
    case Type.BYTE:
    case Type.SHORT:
    case Type.INT:
        return BasicValue.INT_VALUE;
    case Type.FLOAT:
        return BasicValue.FLOAT_VALUE;
    case Type.LONG:
        return BasicValue.LONG_VALUE;
    case Type.DOUBLE:
        return BasicValue.DOUBLE_VALUE;
    case Type.ARRAY:
    case Type.OBJECT:
        return BasicValue.REFERENCE_VALUE;
    default:
        throw new Error("Internal error");
    }
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:27,代碼來源:BasicInterpreter.java

示例7: buildTraceMethodDesc

private static String buildTraceMethodDesc(InterceptedCall call, Type retType) {
    String traceMethodDesc = call.desc.substring(0, call.desc.lastIndexOf(')'));
    if (retType.getSort() != Type.VOID) {
        traceMethodDesc += retType.getDescriptor();
    } else {
        traceMethodDesc += "Ljava/lang/Void;";
    }
    traceMethodDesc += "Lorg/lwjglx/debug/MethodCall;";
    traceMethodDesc += ")V";
    return traceMethodDesc;
}
 
開發者ID:LWJGLX,項目名稱:debug,代碼行數:11,代碼來源:InterceptClassGenerator.java

示例8: checkCastReturn

final protected void checkCastReturn(Type returnType) {
    final int sort = returnType.getSort();
    switch (sort) {
        case Type.VOID: {
            pop();
            mv.visitInsn(Opcodes.RETURN);
            break;
        }
        case Type.BOOLEAN:
        case Type.CHAR:
        case Type.BYTE:
        case Type.SHORT:
        case Type.INT: {
            unbox(returnType);
            returnValue();
            break;
        }
        case Type.FLOAT: {
            unbox(returnType);
            mv.visitInsn(Opcodes.FRETURN);
            break;
        }
        case Type.LONG: {
            unbox(returnType);
            mv.visitInsn(Opcodes.LRETURN);
            break;
        }
        case Type.DOUBLE: {
            unbox(returnType);
            mv.visitInsn(Opcodes.DRETURN);
            break;
        }
        case Type.ARRAY:
        case Type.OBJECT:
        case Type.METHOD:
        default: {
            // checkCast(returnType);
            unbox(returnType);
            mv.visitInsn(ARETURN);
            break;
        }

    }
}
 
開發者ID:alibaba,項目名稱:jvm-sandbox,代碼行數:44,代碼來源:ReWriteMethod.java


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