Examples of LocalBuilder


Examples of com.strobel.reflection.emit.LocalBuilder

    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);

        generator.emitStore(rightStorage);

        generator.emitConversion(leftType, PrimitiveTypes.Boolean);
        generator.emit(OpCode.IFEQ, returnFalse);
View Full Code Here

Examples of com.strobel.reflection.emit.LocalBuilder

    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);

        generator.emitStore(rightStorage);

        generator.emitConversion(leftType, PrimitiveTypes.Boolean);
        generator.emit(OpCode.IFNE, returnTrue);
View Full Code Here

Examples of com.strobel.reflection.emit.LocalBuilder

        generator.endTryBlock();

        final Expression finallyBlock = node.getFinallyBlock();
        final Type tryType = expr.getType();
        final LocalBuilder value;

        if (tryType != PrimitiveTypes.Void) {
            //
            // Store the value of the try body.
            //
            value = getLocal(tryType);
            generator.emitStore(value);
        }
        else {
            value = null;
        }

        if (finallyBlock != null) {
            emitExpression(finallyBlock);
        }

        //
        // Emit the catch blocks.
        //

        for (final CatchBlock cb : node.getHandlers()) {
            pushLabelBlock(LabelScopeKind.Catch);

            //
            // Begin the strongly typed exception block.
            //
            if (cb.getFilter() == null) {
                generator.beginCatchBlock(cb.getTest());
            }
            else {
                throw new UnsupportedOperationException("Filter blocks are not yet supported");
//                generator.beginExceptFilterBlock();
            }

            enterScope(cb);

            emitCatchStart(cb);

            //
            // Emit the catch block body.
            //
            emitExpression(cb.getBody());

            if (tryType != PrimitiveTypes.Void) {
                //
                // Store the value of the catch block body.
                //
                generator.emitStore(value);
            }

            if (finallyBlock != null) {
                emitExpression(finallyBlock);
            }

            exitScope(cb);

            popLabelBlock(LabelScopeKind.Catch);
        }

        //
        // Emit the finally block.
        //

        if (finallyBlock != null) {
            pushLabelBlock(LabelScopeKind.Finally);

            generator.beginFinallyBlock();

            final LocalBuilder exceptionTemp = getLocal(Types.Throwable);

            generator.emitStore(exceptionTemp);

            //
            // Emit the body.
View Full Code Here

Examples of com.strobel.reflection.emit.LocalBuilder

        if (!lc.canEmitBoundConstants()) {
            throw Error.cannotCompileConstant(value);
        }

        final LocalBuilder local = _cache.get(new TypedConstant(value, type));
       
        if (local != null) {
            lc.generator.emitLoad(local);
            return;
        }
View Full Code Here

Examples of com.strobel.reflection.emit.LocalBuilder

                if (--count > 0) {
                    // Dup array to keep it on the stack
                    lc.generator.dup();
                }

                final LocalBuilder local = lc.generator.declareLocal(reference.type);

                emitConstantFromArray(lc, reference.value, local.getLocalType());
                lc.generator.emitStore(local);

                _cache.put(reference, local);
            }
        }
View Full Code Here

Examples of com.strobel.reflection.emit.LocalBuilder

            compiler.generator.putField(_boxValueField);
        }

        @Override
        void emitStore() {
            final LocalBuilder value = compiler.getLocal(variable.getType());
            compiler.generator.emitStore(value);
            emitLoadBox();
            compiler.generator.emitLoad(value);
            compiler.freeLocal(value);
            compiler.generator.putField(_boxValueField);
View Full Code Here

Examples of com.strobel.reflection.emit.LocalBuilder

            compiler.generator.putField(_boxValueField);
        }

        @Override
        void emitStore() {
            final LocalBuilder value = compiler.getLocal(variable.getType());
            compiler.generator.emitStore(value);
            compiler.generator.emitLoad(_boxLocal);
            compiler.generator.emitLoad(value);
            compiler.freeLocal(value);
            compiler.generator.putField(_boxValueField);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.