Package com.strobel.reflection

Examples of com.strobel.reflection.Type


        generator.emitUnbox(finalRightType);
        return finalRightType;
    }

    private Type unboxLeftBinaryOperand(final Type leftType, final Type rightType) {
        final Type finalLeftType = TypeUtils.getUnderlyingPrimitive(leftType);
        final LocalBuilder rightStorage = getLocal(rightType);

        generator.emitStore(rightStorage);
        generator.emitUnbox(finalLeftType);
        generator.emitLoad(rightStorage);
View Full Code Here


        return finalLeftType;
    }

    private void emitLiftedBooleanAnd(final Type leftType, final Type rightType) {
        final Type type = PrimitiveTypes.Boolean;
        final Label returnFalse = generator.defineLabel();
        final Label exit = generator.defineLabel();

        final LocalBuilder rightStorage = getLocal(type);
View Full Code Here

        freeLocal(rightStorage);
    }

    private void emitLiftedBooleanOr(final Type leftType, final Type rightType) {
        final Type type = PrimitiveTypes.Boolean;
        final Label returnTrue = generator.defineLabel();
        final Label exit = generator.defineLabel();

        final LocalBuilder rightStorage = getLocal(type);
View Full Code Here

        final LabelInfo labelInfo = referenceLabel(node.getTarget());

        int finalFlags = flags;

        if (node.getValue() != null) {
            final Type targetType = node.getTarget().getType();

            if (targetType == PrimitiveTypes.Void) {
                emitExpressionAsVoid(node.getValue(), flags);
            }
            else {
View Full Code Here

        // Need to emit the expression start for the lambda body
        flags = updateEmitExpressionStartFlag(flags, CompilationFlags.EmitExpressionStart);

        final Expression body = lambda.getBody();
        final Type<?> bodyType = body.getType();
        final Type returnType = lambda.getReturnType();

        if (returnType == PrimitiveTypes.Void) {
            emitExpressionAsVoid(body, flags);
        }
        else {
View Full Code Here

        final MethodInfo method,
        final IArgumentProvider expr,
        final int flags) {

        // Emit instance, if calling an instance method
        Type targetType = null;

        if (!method.isStatic()) {
            targetType = target.getType();
            emitExpression(target);
        }
View Full Code Here

        emitMethodCall(method, expr, targetType, flags);
    }

    private void emitMethodCall(final Expression target, final MethodInfo method, final MethodCallExpression expr, final int flags) {
        // Emit instance, if calling an instance method
        Type targetType = null;

        if (!method.isStatic()) {
            targetType = target.getType();
            emitExpression(target);
        }
View Full Code Here

        }
        else {
            generator.call(method);
        }

        final Type returnType = method.getReturnType();

        if (returnType != PrimitiveTypes.Void &&
            (method.isGenericMethod() || method.getDeclaringType().isGenericType())) {

            final MethodInfo erasedDefinition = method.getErasedMethodDefinition();
View Full Code Here

            final Type<?> parameterType = parameters.get(i);
            final Expression argument = args.getArgument(i - skipParameters);

            emitExpression(argument);

            final Type argumentType = argument.getType();

            if (method instanceof DynamicMethod) {
                if (argumentType != parameterType) {
                    generator.emitConversion(argumentType, parameterType);
                }
View Full Code Here

    }

    private void emitNewArrayExpression(final Expression expr) {
        final NewArrayExpression node = (NewArrayExpression) expr;
        final ExpressionList<? extends Expression> expressions = node.getExpressions();
        final Type elementType = node.getType().getElementType();

        if (node.getNodeType() == ExpressionType.NewArrayInit) {
            generator.emitArray(
                node.getType().getElementType(),
                node.getExpressions().size(),
View Full Code Here

TOP

Related Classes of com.strobel.reflection.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.