示例#1
0
  /** {@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;
  }
示例#2
0
  /** {@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);
  }