com.android.dx.dex.code.TargetInsn Java Examples

The following examples show how to use com.android.dx.dex.code.TargetInsn. 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: Form22t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof TargetInsn) &&
          (regs.size() == 2) &&
          unsignedFitsInNibble(regs.get(0).getReg()) &&
          unsignedFitsInNibble(regs.get(1).getReg()))) {
        return false;
    }

    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
 
Example #2
Source File: Form20t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!((insn instanceof TargetInsn) &&
          (insn.getRegisters().size() == 0))) {
        return false;
    }

    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
 
Example #3
Source File: Form10t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!((insn instanceof TargetInsn) &&
          (insn.getRegisters().size() == 0))) {
        return false;
    }

    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
 
Example #4
Source File: Form20t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, 0), (short) offset);
}
 
Example #5
Source File: Form20t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean branchFits(TargetInsn insn) {
    int offset = insn.getTargetOffset();

    // Note: A zero offset would fit, but it is prohibited by the spec.
    return (offset != 0) && signedFitsInShort(offset);
}
 
Example #6
Source File: Form30t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!((insn instanceof TargetInsn) &&
          (insn.getRegisters().size() == 0))) {
        return false;
    }

    return true;
}
 
Example #7
Source File: Form30t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, 0), offset);
}
 
Example #8
Source File: Form21t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof TargetInsn) &&
          (regs.size() == 1) &&
          unsignedFitsInByte(regs.get(0).getReg()))) {
        return false;
    }

    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
 
Example #9
Source File: Form21t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean branchFits(TargetInsn insn) {
    int offset = insn.getTargetOffset();

    // Note: A zero offset would fit, but it is prohibited by the spec.
    return (offset != 0) && signedFitsInShort(offset);
}
 
Example #10
Source File: Form21t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out,
          opcodeUnit(insn, regs.get(0).getReg()),
          (short) offset);
}
 
Example #11
Source File: Form22t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof TargetInsn) &&
          (regs.size() == 2) &&
          unsignedFitsInNibble(regs.get(0).getReg()) &&
          unsignedFitsInNibble(regs.get(1).getReg()))) {
        return false;
    }

    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
 
Example #12
Source File: Form22t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean branchFits(TargetInsn insn) {
    int offset = insn.getTargetOffset();

    // Note: A zero offset would fit, but it is prohibited by the spec.
    return (offset != 0) && signedFitsInShort(offset);
}
 
Example #13
Source File: Form22t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out,
          opcodeUnit(insn,
                     makeByte(regs.get(0).getReg(), regs.get(1).getReg())),
          (short) offset);
}
 
Example #14
Source File: Form31t.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, regs.get(0).getReg()), offset);
}
 
Example #15
Source File: Form22t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean branchFits(TargetInsn insn) {
    int offset = insn.getTargetOffset();

    // Note: A zero offset would fit, but it is prohibited by the spec.
    return (offset != 0) && signedFitsInShort(offset);
}
 
Example #16
Source File: Form22t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out,
          opcodeUnit(insn,
                     makeByte(regs.get(0).getReg(), regs.get(1).getReg())),
          (short) offset);
}
 
Example #17
Source File: Form21t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out,
          opcodeUnit(insn, regs.get(0).getReg()),
          (short) offset);
}
 
Example #18
Source File: Form21t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean branchFits(TargetInsn insn) {
    int offset = insn.getTargetOffset();

    // Note: A zero offset would fit, but it is prohibited by the spec.
    return (offset != 0) && signedFitsInShort(offset);
}
 
Example #19
Source File: Form21t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof TargetInsn) &&
          (regs.size() == 1) &&
          unsignedFitsInByte(regs.get(0).getReg()))) {
        return false;
    }

    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
 
Example #20
Source File: Form30t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, 0), offset);
}
 
Example #21
Source File: Form30t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!((insn instanceof TargetInsn) &&
          (insn.getRegisters().size() == 0))) {
        return false;
    }

    return true;
}
 
Example #22
Source File: Form31t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, regs.get(0).getReg()), offset);
}
 
Example #23
Source File: Form31t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    if (!((insn instanceof TargetInsn) &&
          (regs.size() == 1) &&
          unsignedFitsInByte(regs.get(0).getReg()))) {
        return false;
    }

    return true;
}
 
Example #24
Source File: Form10t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, (offset & 0xff)));
}
 
Example #25
Source File: Form10t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean branchFits(TargetInsn insn) {
    int offset = insn.getTargetOffset();

    // Note: A zero offset would fit, but it is prohibited by the spec.
    return (offset != 0) && signedFitsInByte(offset);
}
 
Example #26
Source File: Form10t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!((insn instanceof TargetInsn) &&
          (insn.getRegisters().size() == 0))) {
        return false;
    }

    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
 
Example #27
Source File: Form20t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out, opcodeUnit(insn, 0), (short) offset);
}
 
Example #28
Source File: Form20t.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean branchFits(TargetInsn insn) {
    int offset = insn.getTargetOffset();

    // Note: A zero offset would fit, but it is prohibited by the spec.
    return (offset != 0) && signedFitsInShort(offset);
}
 
Example #29
Source File: Form20t.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!((insn instanceof TargetInsn) &&
          (insn.getRegisters().size() == 0))) {
        return false;
    }

    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
 
Example #30
Source File: Form22t.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();

    write(out,
          opcodeUnit(insn,
                     makeByte(regs.get(0).getReg(), regs.get(1).getReg())),
          (short) offset);
}