mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-09 05:57:36 +02:00
removing fcall4 and fcall5
This commit is contained in:
parent
28b8f8251b
commit
d9017cc20e
6 changed files with 4 additions and 27 deletions
4
eval.c
4
eval.c
|
@ -1311,14 +1311,14 @@ sexp sexp_make_foreign (sexp ctx, const char *name, int num_args,
|
|||
int flags, sexp_proc1 f, sexp data) {
|
||||
sexp res;
|
||||
#if ! SEXP_USE_EXTENDED_FCALL
|
||||
if (num_args > 6)
|
||||
if (num_args > 4)
|
||||
return sexp_user_exception(ctx, NULL, "make-foreign: exceeded foreign arg limit",
|
||||
sexp_make_fixnum(num_args));
|
||||
#endif
|
||||
res = sexp_alloc_type(ctx, opcode, SEXP_OPCODE);
|
||||
sexp_opcode_class(res) = SEXP_OPC_FOREIGN;
|
||||
#if SEXP_USE_EXTENDED_FCALL
|
||||
if (num_args > 6)
|
||||
if (num_args > 4)
|
||||
sexp_opcode_code(res) = SEXP_OP_FCALLN;
|
||||
else
|
||||
#endif
|
||||
|
|
|
@ -60,8 +60,6 @@ enum sexp_opcode_names {
|
|||
SEXP_OP_FCALL2,
|
||||
SEXP_OP_FCALL3,
|
||||
SEXP_OP_FCALL4,
|
||||
SEXP_OP_FCALL5,
|
||||
SEXP_OP_FCALL6,
|
||||
SEXP_OP_FCALLN,
|
||||
SEXP_OP_JUMP_UNLESS,
|
||||
SEXP_OP_JUMP,
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#define _FN2OPTP(t, u, s, d, f) _FN(SEXP_OP_FCALL2, 1, 3, t, u, s, d, f)
|
||||
#define _FN3(t, u, s, d, f) _FN(SEXP_OP_FCALL3, 3, 0, t, u, s, d, f)
|
||||
#define _FN4(t, u, s, d, f) _FN(SEXP_OP_FCALL4, 4, 0, t, u, s, d, f)
|
||||
#define _FN5(t, u, s, d, f) _FN(SEXP_OP_FCALL5, 5, 0, t, u, s, d, f)
|
||||
#define _FN6(t, u, s, d, f) _FN(SEXP_OP_FCALL6, 6, 0, t, u, s, d, f)
|
||||
#define _PARAM(n, a, t) _OP(SEXP_OPC_PARAMETER, SEXP_OP_NOOP, 0, 3, t, 0, 0, n, a, 0)
|
||||
|
||||
static struct sexp_opcode_struct opcodes[] = {
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
|
||||
static const char* reverse_opcode_names[] =
|
||||
{"NOOP", "RAISE", "RESUMECC", "CALLCC", "APPLY1",
|
||||
"TAIL-CALL", "CALL", "FCALL0", "FCALL1", "FCALL2",
|
||||
"FCALL3", "FCALL4", "FCALL5", "FCALL6", "FCALLN",
|
||||
{"NOOP", "RAISE", "RESUMECC", "CALLCC", "APPLY1", "TAIL-CALL", "CALL",
|
||||
"FCALL0", "FCALL1", "FCALL2", "FCALL3", "FCALL4", "FCALLN",
|
||||
"JUMP-UNLESS", "JUMP", "PUSH", "DROP",
|
||||
"GLOBAL-REF", "GLOBAL-KNOWN-REF", "STACK-REF",
|
||||
"LOCAL-REF", "LOCAL-SET", "CLOSURE-REF",
|
||||
|
|
|
@ -272,8 +272,6 @@
|
|||
(s-args '()))
|
||||
(cond
|
||||
((null? ls)
|
||||
;;(if (> i 6)
|
||||
;; (error "FFI currently only supports up to 6 scheme args" func))
|
||||
(vector scheme-name c-name stub-name ret-type
|
||||
(reverse results) (reverse c-args) (reverse s-args)))
|
||||
(else
|
||||
|
|
16
vm.c
16
vm.c
|
@ -722,22 +722,6 @@ sexp sexp_vm (sexp ctx, sexp proc) {
|
|||
ip += sizeof(sexp);
|
||||
sexp_check_exception();
|
||||
break;
|
||||
case SEXP_OP_FCALL5:
|
||||
_ALIGN_IP();
|
||||
sexp_context_top(ctx) = top;
|
||||
_ARG5 = ((sexp_proc6)sexp_opcode_func(_WORD0))(ctx sexp_api_pass(_WORD0, 5), _ARG1, _ARG2, _ARG3, _ARG4, _ARG5);
|
||||
top -= 4;
|
||||
ip += sizeof(sexp);
|
||||
sexp_check_exception();
|
||||
break;
|
||||
case SEXP_OP_FCALL6:
|
||||
_ALIGN_IP();
|
||||
sexp_context_top(ctx) = top;
|
||||
_ARG6 = ((sexp_proc7)sexp_opcode_func(_WORD0))(ctx sexp_api_pass(_WORD0, 6), _ARG1, _ARG2, _ARG3, _ARG4, _ARG5, _ARG6);
|
||||
top -= 5;
|
||||
ip += sizeof(sexp);
|
||||
sexp_check_exception();
|
||||
break;
|
||||
#if SEXP_USE_EXTENDED_FCALL
|
||||
case SEXP_OP_FCALLN:
|
||||
_ALIGN_IP();
|
||||
|
|
Loading…
Add table
Reference in a new issue