Package com.android.dx.rop.code

Examples of com.android.dx.rop.code.PlainInsn


     * Transfers flow control to the instructions at {@code target}. It is an
     * error to jump to a label not marked on this {@code Code}.
     */
    public void jump(Label target) {
        adopt(target);
        addInstruction(new PlainInsn(Rops.GOTO, sourcePosition, null, RegisterSpecList.EMPTY),
                target);
    }
View Full Code Here


    /**
     * Copies the value in {@code source} to {@code target}.
     */
    public <T> void move(Local<T> target, Local<T> source) {
        addInstruction(new PlainInsn(Rops.opMove(source.type.ropType),
                sourcePosition, target.spec(), source.spec()));
    }
View Full Code Here

    /**
     * Executes {@code op} and sets {@code target} to the result.
     */
    public <T> void op(UnaryOp op, Local<T> target, Local<T> source) {
        addInstruction(new PlainInsn(op.rop(source.type), sourcePosition,
                target.spec(), source.spec()));
    }
View Full Code Here

    public <T1, T2> void op(BinaryOp op, Local<T1> target, Local<T1> a, Local<T2> b) {
        Rop rop = op.rop(StdTypeList.make(a.type.ropType, b.type.ropType));
        RegisterSpecList sources = RegisterSpecList.make(a.spec(), b.spec());

        if (rop.getBranchingness() == BRANCH_NONE) {
            addInstruction(new PlainInsn(rop, sourcePosition, target.spec(), sources));
        } else {
            addInstruction(new ThrowingInsn(rop, sourcePosition, sources, catches));
            moveResult(target, true);
        }
    }
View Full Code Here

     */
    public <T> void compare(Comparison comparison, Label trueLabel, Local<T> a, Local<T> b) {
        adopt(trueLabel);
        // TODO: ops to compare with zero/null: just omit the 2nd local in StdTypeList.make()
        Rop rop = comparison.rop(StdTypeList.make(a.type.ropType, b.type.ropType));
        addInstruction(new PlainInsn(rop, sourcePosition, null,
                RegisterSpecList.make(a.spec(), b.spec())), trueLabel);
    }
View Full Code Here

        } else if (nanValue == -1) {
            rop = Rops.opCmpl(a.type.ropType);
        } else {
            throw new IllegalArgumentException("expected 1 or -1 but was " + nanValue);
        }
        addInstruction(new PlainInsn(rop, sourcePosition, target.spec(),
                RegisterSpecList.make(a.spec(), b.spec())));
    }
View Full Code Here

     * Compare longs. This stores -1 in {@code target} if {@code
     * a < b}, 0 in {@code target} if {@code a == b} and 1 in target if {@code
     * a > b}.
     */
    public void compareLongs(Local<Integer> target, Local<Long> a, Local<Long> b) {
        addInstruction(new PlainInsn(Rops.CMPL_LONG, sourcePosition, target.spec(),
                RegisterSpecList.make(a.spec(), b.spec())));
    }
View Full Code Here

        if (source.getType().ropType.isReference()) {
            addInstruction(new ThrowingCstInsn(Rops.CHECK_CAST, sourcePosition,
                    RegisterSpecList.make(source.spec()), catches, target.type.constant));
            moveResult(target, true);
        } else {
            addInstruction(new PlainInsn(getCastRop(source.type.ropType, target.type.ropType),
                    sourcePosition, target.spec(), source.spec()));
        }
    }
View Full Code Here

    public void returnVoid() {
        if (!method.returnType.equals(TypeId.VOID)) {
            throw new IllegalArgumentException("declared " + method.returnType
                    + " but returned void");
        }
        addInstruction(new PlainInsn(Rops.RETURN_VOID, sourcePosition, null,
                RegisterSpecList.EMPTY));
    }
View Full Code Here

        if (!result.type.equals(method.returnType)) {
            // TODO: this is probably too strict.
            throw new IllegalArgumentException("declared " + method.returnType
                    + " but returned " + result.type);
        }
        addInstruction(new PlainInsn(Rops.opReturn(result.type.ropType), sourcePosition,
                null, RegisterSpecList.make(result.spec())));
    }
View Full Code Here

TOP

Related Classes of com.android.dx.rop.code.PlainInsn

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.