/** * Constructs an instance. * * @param prototype {@code non-null;} the prototype for the * associated method */ public BaseMachine(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } this.prototype = prototype; args = new TypeBearer[10]; results = new TypeBearer[6]; clearArgs(); }
@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()); } }
throwLocalMismatch(resultType, localType); return null;
/** * Stores the results of the latest operation into the given frame. If * there is a local target (see {@link #localTarget}), then the sole * result is stored to that target; otherwise any results are pushed * onto the stack. * * @param frame {@code non-null;} frame to operate on */ protected final void storeResults(Frame frame) { if (resultCount < 0) { throw new SimException("results never set"); } if (resultCount == 0) { // Nothing to do. return; } if (localTarget != null) { /* * Note: getLocalTarget() doesn't necessarily return * localTarget directly. */ frame.getLocals().set(getLocalTarget()); } else { ExecutionStack stack = frame.getStack(); for (int i = 0; i < resultCount; i++) { stack.push(results[i]); } } }
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()); } }
throwLocalMismatch(resultType, localType); return null;
frame.getLocals().set(getLocalTarget(false)); } else { ExecutionStack stack = frame.getStack();
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()); } }
/** * Constructs an instance. * * @param prototype {@code non-null;} the prototype for the associated method */ public BaseMachine(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } this.prototype = prototype; args = new TypeBearer[10]; results = new TypeBearer[6]; clearArgs(); }
throwLocalMismatch(resultType, localType); return null;
frame.getLocals().set(getLocalTarget(false)); } else { ExecutionStack stack = frame.getStack();
@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()); } }
/** * Constructs an instance. * * @param prototype {@code non-null;} the prototype for the * associated method */ public BaseMachine(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } this.prototype = prototype; args = new TypeBearer[10]; results = new TypeBearer[6]; clearArgs(); }
throwLocalMismatch(resultType, localType); return null;
frame.getLocals().set(getLocalTarget(false)); } else { ExecutionStack stack = frame.getStack();
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()); } }
/** * Constructs an instance. * * @param prototype {@code non-null;} the prototype for the * associated method */ public BaseMachine(Prototype prototype) { if (prototype == null) { throw new NullPointerException("prototype == null"); } this.prototype = prototype; args = new TypeBearer[10]; results = new TypeBearer[6]; clearArgs(); }
throwLocalMismatch(resultType, localType); return null;
frame.getLocals().set(getLocalTarget(false)); } else { ExecutionStack stack = frame.getStack();
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()); } }