com.android.dx.rop.code.ThrowingInsn Java Examples

The following examples show how to use com.android.dx.rop.code.ThrowingInsn. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RopTranslator.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public void visitThrowingInsn(ThrowingInsn insn) {
    SourcePosition pos = insn.getPosition();
    Dop opcode = RopToDop.dopFor(insn);
    Rop rop = insn.getOpcode();
    RegisterSpec realResult;

    if (rop.getBranchingness() != Rop.BRANCH_THROW) {
        throw new RuntimeException("shouldn't happen");
    }

    realResult = getNextMoveResultPseudo();

    if (opcode.hasResult() != (realResult != null)) {
        throw new RuntimeException(
                "Insn with result/move-result-pseudo mismatch" + insn);
    }

    addOutput(lastAddress);

    DalvInsn di = new SimpleInsn(opcode, pos,
            getRegs(insn, realResult));

    addOutput(di);
}
 
Example #2
Source File: RopTranslator.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public void visitThrowingInsn(ThrowingInsn insn) {
    SourcePosition pos = insn.getPosition();
    Dop opcode = RopToDop.dopFor(insn);
    Rop rop = insn.getOpcode();
    RegisterSpec realResult;

    if (rop.getBranchingness() != Rop.BRANCH_THROW) {
        throw new RuntimeException("shouldn't happen");
    }

    realResult = getNextMoveResultPseudo();

    if (opcode.hasResult() != (realResult != null)) {
        throw new RuntimeException(
                "Insn with result/move-result-pseudo mismatch" + insn);
    }

    addOutput(lastAddress);

    DalvInsn di = new SimpleInsn(opcode, pos,
            getRegs(insn, realResult));

    addOutput(di);
}
 
Example #3
Source File: RopTranslator.java    From buck with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
public void visitThrowingInsn(ThrowingInsn insn) {
    SourcePosition pos = insn.getPosition();
    Dop opcode = RopToDop.dopFor(insn);
    Rop rop = insn.getOpcode();
    RegisterSpec realResult;

    if (rop.getBranchingness() != Rop.BRANCH_THROW) {
        throw new RuntimeException("shouldn't happen");
    }

    realResult = getNextMoveResultPseudo();

    if (opcode.hasResult() != (realResult != null)) {
        throw new RuntimeException(
                "Insn with result/move-result-pseudo mismatch" + insn);
    }

    addOutput(lastAddress);

    DalvInsn di = new SimpleInsn(opcode, pos,
            getRegs(insn, realResult));

    addOutput(di);
}
 
Example #4
Source File: RopTranslator.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public void visitThrowingInsn(ThrowingInsn insn) {
    SourcePosition pos = insn.getPosition();
    Dop opcode = RopToDop.dopFor(insn);
    Rop rop = insn.getOpcode();
    RegisterSpec realResult;

    if (rop.getBranchingness() != Rop.BRANCH_THROW) {
        throw new RuntimeException("shouldn't happen");
    }

    realResult = getNextMoveResultPseudo();

    if (opcode.hasResult() != (realResult != null)) {
        throw new RuntimeException(
                "Insn with result/move-result-pseudo mismatch" + insn);
    }

    addOutput(lastAddress);

    DalvInsn di = new SimpleInsn(opcode, pos,
            getRegs(insn, realResult));

    addOutput(di);
}
 
Example #5
Source File: RopTranslator.java    From buck with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public void visitThrowingInsn(ThrowingInsn insn) {
    super.visitThrowingInsn(insn);
    addIntroductionIfNecessary(insn);
}
 
Example #6
Source File: Code.java    From dexmaker with Apache License 2.0 4 votes vote down vote up
/**
 * Releases the held lock on {@code monitor}.
 */
public void monitorExit(Local<?> monitor) {
    addInstruction(new ThrowingInsn(Rops.MONITOR_EXIT, sourcePosition,
            RegisterSpecList.make(monitor.spec()), catches));
}
 
Example #7
Source File: Code.java    From dexmaker with Apache License 2.0 4 votes vote down vote up
/**
 * Awaits the lock on {@code monitor}, and acquires it.
 */
public void monitorEnter(Local<?> monitor) {
    addInstruction(new ThrowingInsn(Rops.MONITOR_ENTER, sourcePosition,
            RegisterSpecList.make(monitor.spec()), catches));
}
 
Example #8
Source File: Code.java    From dexmaker with Apache License 2.0 4 votes vote down vote up
/**
 * Assigns {@code source} to the element at {@code index} in {@code array}.
 */
public void aput(Local<?> array, Local<Integer> index, Local<?> source) {
    addInstruction(new ThrowingInsn(Rops.opAput(source.type.ropType), sourcePosition,
            RegisterSpecList.make(source.spec(), array.spec(), index.spec()), catches));
}
 
Example #9
Source File: Code.java    From dexmaker with Apache License 2.0 4 votes vote down vote up
/**
 * Assigns the element at {@code index} in {@code array} to {@code target}.
 */
public void aget(Local<?> target, Local<?> array, Local<Integer> index) {
    addInstruction(new ThrowingInsn(Rops.opAget(target.type.ropType), sourcePosition,
            RegisterSpecList.make(array.spec(), index.spec()), catches));
    moveResult(target, true);
}
 
Example #10
Source File: Code.java    From dexmaker with Apache License 2.0 4 votes vote down vote up
/**
 * Sets {@code target} to the length of the array in {@code array}.
 */
public <T> void arrayLength(Local<Integer> target, Local<T> array) {
    addInstruction(new ThrowingInsn(Rops.ARRAY_LENGTH, sourcePosition,
            RegisterSpecList.make(array.spec()), catches));
    moveResult(target, true);
}
 
Example #11
Source File: Code.java    From dexmaker with Apache License 2.0 4 votes vote down vote up
/**
 * Throws the throwable in {@code toThrow}.
 */
public void throwValue(Local<? extends Throwable> toThrow) {
    addInstruction(new ThrowingInsn(Rops.THROW, sourcePosition,
            RegisterSpecList.make(toThrow.spec()), catches));
}
 
Example #12
Source File: RopTranslator.java    From J2ME-Loader with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public void visitThrowingInsn(ThrowingInsn insn) {
    super.visitThrowingInsn(insn);
    addIntroductionIfNecessary(insn);
}
 
Example #13
Source File: Code.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Releases the held lock on {@code monitor}.
 */
public void monitorExit(Local<?> monitor) {
    addInstruction(new ThrowingInsn(Rops.MONITOR_EXIT, sourcePosition,
            RegisterSpecList.make(monitor.spec()), catches));
}
 
Example #14
Source File: Code.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Awaits the lock on {@code monitor}, and acquires it.
 */
public void monitorEnter(Local<?> monitor) {
    addInstruction(new ThrowingInsn(Rops.MONITOR_ENTER, sourcePosition,
            RegisterSpecList.make(monitor.spec()), catches));
}
 
Example #15
Source File: Code.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Assigns {@code source} to the element at {@code index} in {@code array}.
 */
public void aput(Local<?> array, Local<Integer> index, Local<?> source) {
    addInstruction(new ThrowingInsn(Rops.opAput(source.type.ropType), sourcePosition,
            RegisterSpecList.make(source.spec(), array.spec(), index.spec()), catches));
}
 
Example #16
Source File: Code.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Assigns the element at {@code index} in {@code array} to {@code target}.
 */
public void aget(Local<?> target, Local<?> array, Local<Integer> index) {
    addInstruction(new ThrowingInsn(Rops.opAget(target.type.ropType), sourcePosition,
            RegisterSpecList.make(array.spec(), index.spec()), catches));
    moveResult(target, true);
}
 
Example #17
Source File: Code.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Sets {@code target} to the length of the array in {@code array}.
 */
public <T> void arrayLength(Local<Integer> target, Local<T> array) {
    addInstruction(new ThrowingInsn(Rops.ARRAY_LENGTH, sourcePosition,
            RegisterSpecList.make(array.spec()), catches));
    moveResult(target, true);
}
 
Example #18
Source File: Code.java    From lua-for-android with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * Throws the throwable in {@code toThrow}.
 */
public void throwValue(Local<? extends Throwable> toThrow) {
    addInstruction(new ThrowingInsn(Rops.THROW, sourcePosition,
            RegisterSpecList.make(toThrow.spec()), catches));
}
 
Example #19
Source File: RopTranslator.java    From Box with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public void visitThrowingInsn(ThrowingInsn insn) {
    super.visitThrowingInsn(insn);
    addIntroductionIfNecessary(insn);
}
 
Example #20
Source File: RopTranslator.java    From Box with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public void visitThrowingInsn(ThrowingInsn insn) {
    super.visitThrowingInsn(insn);
    addIntroductionIfNecessary(insn);
}