code: public void swap(final Type prev, final Type type) {
          if (type.getSize() == 1) {
              if (prev.getSize() == 1) {
                  swap(); // same as dupX1(), pop();
              } else {
                  dupX2();
                  pop();
              }
          } else {
              if (prev.getSize() == 1) {
                  dup2X1();
                  pop2();
              } else {
                  dup2X2();
                  pop2();
              }
          }
      }
docs: Generates the instructions to swap the top two stack values.
  
  @param prev
  type of the top - 1 stack value.
  @param type
  type of the top stack value.