示例#1
0
  /**
   * Gets the size of the outgoing arguments area required by this method. This is equal to the
   * largest argument word count of any method referred to by this instance.
   *
   * @return {@code >= 0;} the required outgoing arguments size
   */
  public int getOutsSize() {
    int sz = size();
    int result = 0;

    for (int i = 0; i < sz; i++) {
      DalvInsn insn = (DalvInsn) get0(i);

      if (!(insn instanceof CstInsn)) {
        continue;
      }

      Constant cst = ((CstInsn) insn).getConstant();

      if (!(cst instanceof CstBaseMethodRef)) {
        continue;
      }

      boolean isStatic = (insn.getOpcode().getFamily() == DalvOps.INVOKE_STATIC);
      int count = ((CstBaseMethodRef) cst).getParameterWordCount(isStatic);

      if (count > result) {
        result = count;
      }
    }

    return result;
  }