mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-13 15:57:36 +02:00
Refactoring
This commit is contained in:
parent
e892ed2270
commit
ef4ad29969
1 changed files with 8 additions and 8 deletions
16
runtime.c
16
runtime.c
|
@ -74,37 +74,37 @@ void Cyc_check_bounds(void *data, const char *label, int len, int index) {
|
|||
/* END error checking */
|
||||
|
||||
/* These macros are hardcoded here to support functions in this module. */
|
||||
#define closcall1(td, clo,a1) \
|
||||
#define closcall1(td, clo, a1) \
|
||||
if (type_of(clo) == pair_tag || prim(clo)) { \
|
||||
Cyc_apply(td, 0, (closure)(a1), clo); \
|
||||
} else { \
|
||||
((clo)->fn)(td, 1, clo,a1);\
|
||||
((clo)->fn)(td, 1, clo, a1);\
|
||||
}
|
||||
#define return_closcall1(td, clo,a1) { \
|
||||
#define return_closcall1(td, clo, a1) { \
|
||||
char top; \
|
||||
if (stack_overflow(&top, (((gc_thread_data *)data)->stack_limit))) { \
|
||||
object buf[1]; buf[0] = a1;\
|
||||
GC(td, clo, buf, 1); \
|
||||
return; \
|
||||
} else {\
|
||||
closcall1(td, (closure) (clo),a1); \
|
||||
closcall1(td, (closure) (clo), a1); \
|
||||
return;\
|
||||
} \
|
||||
}
|
||||
#define closcall2(td, clo,a1,a2) \
|
||||
#define closcall2(td, clo, a1, a2) \
|
||||
if (type_of(clo) == pair_tag || prim(clo)) { \
|
||||
Cyc_apply(td, 1, (closure)(a1), clo,a2); \
|
||||
} else { \
|
||||
((clo)->fn)(td, 2, clo,a1,a2);\
|
||||
((clo)->fn)(td, 2, clo, a1, a2);\
|
||||
}
|
||||
#define return_closcall2(td, clo,a1,a2) { \
|
||||
#define return_closcall2(td, clo, a1, a2) { \
|
||||
char top; \
|
||||
if (stack_overflow(&top, (((gc_thread_data *)data)->stack_limit))) { \
|
||||
object buf[2]; buf[0] = a1;buf[1] = a2;\
|
||||
GC(td, clo, buf, 2); \
|
||||
return; \
|
||||
} else {\
|
||||
closcall2(td, (closure) (clo),a1,a2); \
|
||||
closcall2(td, (closure) (clo), a1, a2); \
|
||||
return;\
|
||||
} \
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue