Esempio n. 1
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);
    }
  }