/** {@inheritDoc} */ @Override public Type getType() { return type.getType(); }
/** {@inheritDoc} */ @Override public Type getType() { return type.getType(); }
/** * Returns the appropriate {@code move-result} rop for the * given type. The result may be a shared instance. * * @param type {@code non-null;} type of the parameter * @return {@code non-null;} an appropriate instance */ public static Rop opMoveResult(TypeBearer type) { return new Rop(RegOps.MOVE_RESULT, type.getType(), StdTypeList.EMPTY, (String) null); }
/** * Returns the appropriate {@code move-exception} rop for the * given type. The result may be a shared instance. * * @param type {@code non-null;} type of the exception * @return {@code non-null;} an appropriate instance */ public static Rop opMoveException(TypeBearer type) { return new Rop(RegOps.MOVE_EXCEPTION, type.getType(), StdTypeList.EMPTY, (String) null); }
/** * Gets whether this instance's type is category 2. This is just a * convenient shorthand for {@code getType().isCategory2()}. * * @see #getCategory * @see #isCategory1 * @return whether or not this instance's type is of category 2 */ public boolean isCategory2() { return type.getType().isCategory2(); }
/** * Peeks at the {@code n}th element down from the top of the * stack, returning the type per se, as opposed to the * <i>type-bearer</i>. This method is just a convenient shorthand * for {@code peek(n).getType()}. * * @see #peek */ public Type peekType(int n) { return peek(n).getType(); }
/** * Peeks at the {@code n}th element down from the top of the * stack, returning the type per se, as opposed to the * <i>type-bearer</i>. This method is just a convenient shorthand * for {@code peek(n).getType()}. * * @see #peek */ public Type peekType(int n) { return peek(n).getType(); }
/** * Returns the appropriate {@code move-result} rop for the * given type. The result may be a shared instance. * * @param type {@code non-null;} type of the parameter * @return {@code non-null;} an appropriate instance */ public static Rop opMoveResult(TypeBearer type) { return new Rop(RegOps.MOVE_RESULT, type.getType(), StdTypeList.EMPTY, (String) null); }
/** * Gets the category of this instance's type. This is just a convenient * shorthand for {@code getType().getCategory()}. * * @see #isCategory1 * @see #isCategory2 * @return {@code 1..2;} the category of this instance's type */ public int getCategory() { return type.getType().getCategory(); }
/** * Gets the category of this instance's type. This is just a convenient * shorthand for {@code getType().getCategory()}. * * @see #isCategory1 * @see #isCategory2 * @return {@code 1..2;} the category of this instance's type */ public int getCategory() { return type.getType().getCategory(); }
/** * Peeks at the {@code n}th element down from the top of the * stack, returning the type per se, as opposed to the * <i>type-bearer</i>. This method is just a convenient shorthand * for {@code peek(n).getType()}. * * @see #peek */ public Type peekType(int n) { return peek(n).getType(); }
/** * Gets the category of this instance's type. This is just a convenient * shorthand for {@code getType().getCategory()}. * * @see #isCategory1 * @see #isCategory2 * @return {@code 1..2;} the category of this instance's type */ public int getCategory() { return type.getType().getCategory(); }
/** * Gets whether this instance's type is category 1. This is just a * convenient shorthand for {@code getType().isCategory1()}. * * @see #getCategory * @see #isCategory2 * @return whether or not this instance's type is of category 1 */ public boolean isCategory1() { return type.getType().isCategory1(); }
/** * Returns the appropriate {@code move-exception} rop for the * given type. The result may be a shared instance. * * @param type {@code non-null;} type of the exception * @return {@code non-null;} an appropriate instance */ public static Rop opMoveException(TypeBearer type) { return new Rop(RegOps.MOVE_EXCEPTION, type.getType(), StdTypeList.EMPTY, (String) null); }
/** * Gets whether this instance's type is category 1. This is just a * convenient shorthand for {@code getType().isCategory1()}. * * @see #getCategory * @see #isCategory2 * @return whether or not this instance's type is of category 1 */ public boolean isCategory1() { return type.getType().isCategory1(); }
/** * Returns the appropriate {@code move-exception} rop for the * given type. The result may be a shared instance. * * @param type {@code non-null;} type of the exception * @return {@code non-null;} an appropriate instance */ public static Rop opMoveException(TypeBearer type) { return new Rop(RegOps.MOVE_EXCEPTION, type.getType(), StdTypeList.EMPTY, (String) null); }
/** * Returns the appropriate {@code move-result-pseudo} rop for the * given type. The result may be a shared instance. * * @param type {@code non-null;} type of the parameter * @return {@code non-null;} an appropriate instance */ public static Rop opMoveResultPseudo(TypeBearer type) { return new Rop(RegOps.MOVE_RESULT_PSEUDO, type.getType(), StdTypeList.EMPTY, (String) null); }
@Override public final void popArgs(Frame frame, Type type) { // Use the above method to do the actual popping... popArgs(frame, 1); // ...and then verify the popped type. if (! Merger.isPossiblyAssignableFrom(type, args[0])) { throw new SimException("expected type " + type.toHuman() + " but found " + args[0].getType().toHuman()); } }
/** {@inheritDoc} */ public TypeBearer getCategory1(int idx) { TypeBearer result = get(idx); Type type = result.getType(); if (type.isUninitialized()) { return throwSimException(idx, "uninitialized instance"); } if (type.isCategory2()) { return throwSimException(idx, "category-2"); } return result; }
@Override public final void popArgs(Frame frame, Type type) { // Use the above method to do the actual popping... popArgs(frame, 1); // ...and then verify the popped type. if (! Merger.isPossiblyAssignableFrom(type, args[0])) { throw new SimException("expected type " + type.toHuman() + " but found " + args[0].getType().toHuman()); } }