mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
parent
8802ec2a67
commit
61d0f3396b
3 changed files with 27 additions and 13 deletions
|
@ -14,7 +14,12 @@
|
||||||
|
|
||||||
/* These macros are hardcoded here to support functions in this module. */
|
/* These macros are hardcoded here to support functions in this module. */
|
||||||
#define closcall1(td, clo, buf) \
|
#define closcall1(td, clo, buf) \
|
||||||
((clo)->fn)(td, clo, 1, buf);
|
if (obj_is_not_closure(clo)) { \
|
||||||
|
Cyc_apply(td, clo, 1, buf ); \
|
||||||
|
} else { \
|
||||||
|
((clo)->fn)(td, clo, 1, buf); \
|
||||||
|
;\
|
||||||
|
}
|
||||||
#define return_closcall1(td, clo,a1) { \
|
#define return_closcall1(td, clo,a1) { \
|
||||||
char top; \
|
char top; \
|
||||||
object buf[1]; buf[0] = a1;\
|
object buf[1]; buf[0] = a1;\
|
||||||
|
|
22
runtime.c
22
runtime.c
|
@ -129,7 +129,12 @@ void hrt_log_delta(const char *label, long long tstamp)
|
||||||
|
|
||||||
/* These macros are hardcoded here to support functions in this module. */
|
/* These macros are hardcoded here to support functions in this module. */
|
||||||
#define closcall1(td, clo, buf) \
|
#define closcall1(td, clo, buf) \
|
||||||
((clo)->fn)(td, clo, 1, buf);
|
if (obj_is_not_closure(clo)) { \
|
||||||
|
Cyc_apply(td, clo, 1, buf ); \
|
||||||
|
} else { \
|
||||||
|
((clo)->fn)(td, clo, 1, buf); \
|
||||||
|
;\
|
||||||
|
}
|
||||||
#define return_closcall1(td, clo,a1) { \
|
#define return_closcall1(td, clo,a1) { \
|
||||||
char top; \
|
char top; \
|
||||||
object buf[1]; buf[0] = a1;\
|
object buf[1]; buf[0] = a1;\
|
||||||
|
@ -153,7 +158,12 @@ void hrt_log_delta(const char *label, long long tstamp)
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
#define closcall2(td, clo, buf) \
|
#define closcall2(td, clo, buf) \
|
||||||
((clo)->fn)(td, clo, 2, buf);
|
if (obj_is_not_closure(clo)) { \
|
||||||
|
Cyc_apply(td, clo, 2, buf ); \
|
||||||
|
} else { \
|
||||||
|
((clo)->fn)(td, clo, 2, buf); \
|
||||||
|
;\
|
||||||
|
}
|
||||||
#define return_closcall2(td, clo,a1,a2) { \
|
#define return_closcall2(td, clo,a1,a2) { \
|
||||||
char top; \
|
char top; \
|
||||||
object buf[2]; buf[0] = a1;buf[1] = a2;\
|
object buf[2]; buf[0] = a1;buf[1] = a2;\
|
||||||
|
@ -5906,12 +5916,12 @@ void Cyc_start_trampoline(gc_thread_data * thd)
|
||||||
printf("Done with GC\n");
|
printf("Done with GC\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//if (obj_is_not_closure(thd->gc_cont)) {
|
if (obj_is_not_closure(thd->gc_cont)) {
|
||||||
// Cyc_apply_from_buf(thd, thd->gc_num_args, thd->gc_cont, thd->gc_args);
|
Cyc_apply_from_buf(thd, thd->gc_num_args, thd->gc_cont, thd->gc_args);
|
||||||
//} else {
|
} else {
|
||||||
closure clo = thd->gc_cont;
|
closure clo = thd->gc_cont;
|
||||||
(clo->fn)(thd, clo, thd->gc_num_args, thd->gc_args);
|
(clo->fn)(thd, clo, thd->gc_num_args, thd->gc_args);
|
||||||
//}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "Internal error: should never have reached this line\n");
|
fprintf(stderr, "Internal error: should never have reached this line\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -242,13 +242,12 @@
|
||||||
(wrap (lambda (s) (if (> num-args 0) s ""))))
|
(wrap (lambda (s) (if (> num-args 0) s ""))))
|
||||||
(string-append
|
(string-append
|
||||||
"#define closcall" n "(td, clo, buf) \\\n"
|
"#define closcall" n "(td, clo, buf) \\\n"
|
||||||
;(wrap (string-append "if (obj_is_not_closure(clo)) { \\\n"
|
(wrap (string-append "if (obj_is_not_closure(clo)) { \\\n"
|
||||||
; " Cyc_apply(td, clo, " n ", buf ); \\\n"
|
" Cyc_apply(td, clo, " n ", buf ); \\\n"
|
||||||
; "}"))
|
"}"))
|
||||||
;(wrap " else { \\\n")
|
(wrap " else { \\\n")
|
||||||
" ((clo)->fn)(td, clo, " n ", buf); \\\n"
|
" ((clo)->fn)(td, clo, " n ", buf); \\\n"
|
||||||
;(wrap ";\\\n}")
|
(wrap ";\\\n}"))))
|
||||||
)))
|
|
||||||
|
|
||||||
(define (c-macro-n-prefix n prefix)
|
(define (c-macro-n-prefix n prefix)
|
||||||
(if (> n 0)
|
(if (> n 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue