throws UnresolvedControlThrowable { try { mt_invoke(context, target, arg1, arg2, arg3); evaluateTailCalls(context);
throws UnresolvedControlThrowable { try { mt_invoke(context, target, arg1, arg2); evaluateTailCalls(context);
throws UnresolvedControlThrowable { try { mt_invoke(context, target); evaluateTailCalls(context);
throws UnresolvedControlThrowable { try { mt_invoke(context, target, arg1); evaluateTailCalls(context);
throws UnresolvedControlThrowable { try { mt_invoke(context, target, arg1, arg2, arg3, arg4); evaluateTailCalls(context);
throws UnresolvedControlThrowable { try { mt_invoke(context, target, arg1, arg2, arg3, arg4, arg5); evaluateTailCalls(context);
throws UnresolvedControlThrowable { try { mt_invoke(context, target, args); evaluateTailCalls(context);
/** * Evaluates tail calls stored in the return buffer associated with the execution * context {@code context}. * <b>This method throws a {@link ResolvedControlThrowable}</b>: * this method is expected to have resolved non-local control changes up to the point * of its invocation. * * @param context execution context, must not be {@code null} * * @throws ResolvedControlThrowable if a tail call initiates a non-local control change * @throws NullPointerException if {@code context} is {@code null} * @throws IllegalOperationAttemptException if a tail call of a non-callable value * is attempted */ @SuppressWarnings("unused") static void evaluateTailCalls(ExecutionContext context) throws ResolvedControlThrowable { ReturnBuffer r = context.getReturnBuffer(); while (r.isCall()) { Object target = r.getCallTarget(); switch (r.size()) { case 0: mt_invoke(context, target); break; case 1: mt_invoke(context, target, r.get0()); break; case 2: mt_invoke(context, target, r.get0(), r.get1()); break; case 3: mt_invoke(context, target, r.get0(), r.get1(), r.get2()); break; case 4: mt_invoke(context, target, r.get0(), r.get1(), r.get2(), r.get3()); break; case 5: mt_invoke(context, target, r.get0(), r.get1(), r.get2(), r.get3(), r.get4()); break; default: mt_invoke(context, target, r.getAsArray()); break; } } }