示例#1
0
  private void putParameterOnStack(ParameterInfo... infos) {
    int[] index = new int[infos.length];
    for (int i = 0; i < infos.length; i++) {
      ParameterInfo info = infos[i];
      if (!info.isSkippedOrRemapped()) {
        index[i] = codegen.getFrameMap().enterTemp(info.getType());
      } else {
        index[i] = -1;
      }
    }

    for (int i = infos.length - 1; i >= 0; i--) {
      ParameterInfo info = infos[i];
      if (!info.isSkippedOrRemapped()) {
        Type type = info.type;
        StackValue.local(index[i], type).store(StackValue.onStack(type), codegen.v);
      }
    }
  }
示例#2
0
  public static void putStackValuesIntoLocals(
      List<Type> directOrder, int shift, InstructionAdapter iv, String descriptor) {
    Type[] actualParams = Type.getArgumentTypes(descriptor);
    assert actualParams.length == directOrder.size()
        : "Number of expected and actual params should be equals!";

    int size = 0;
    for (Type next : directOrder) {
      size += next.getSize();
    }

    shift += size;
    int index = directOrder.size();

    for (Type next : Lists.reverse(directOrder)) {
      shift -= next.getSize();
      Type typeOnStack = actualParams[--index];
      if (!typeOnStack.equals(next)) {
        StackValue.onStack(typeOnStack).put(next, iv);
      }
      iv.store(shift, next);
    }
  }