Revert "Eliminate unnecessary code"

This reverts commit 8802ec2a67.
This commit is contained in:
Justin Ethier 2021-05-25 21:30:25 -04:00
parent 8802ec2a67
commit 61d0f3396b
3 changed files with 27 additions and 13 deletions

View file

@ -14,7 +14,12 @@
/* These macros are hardcoded here to support functions in this module. */
#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) { \
char top; \
object buf[1]; buf[0] = a1;\

View file

@ -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. */
#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) { \
char top; \
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) \
((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) { \
char top; \
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");
#endif
//if (obj_is_not_closure(thd->gc_cont)) {
// Cyc_apply_from_buf(thd, thd->gc_num_args, thd->gc_cont, thd->gc_args);
//} else {
if (obj_is_not_closure(thd->gc_cont)) {
Cyc_apply_from_buf(thd, thd->gc_num_args, thd->gc_cont, thd->gc_args);
} else {
closure clo = thd->gc_cont;
(clo->fn)(thd, clo, thd->gc_num_args, thd->gc_args);
//}
}
fprintf(stderr, "Internal error: should never have reached this line\n");
exit(1);

View file

@ -242,13 +242,12 @@
(wrap (lambda (s) (if (> num-args 0) s ""))))
(string-append
"#define closcall" n "(td, clo, buf) \\\n"
;(wrap (string-append "if (obj_is_not_closure(clo)) { \\\n"
; " Cyc_apply(td, clo, " n ", buf ); \\\n"
; "}"))
;(wrap " else { \\\n")
(wrap (string-append "if (obj_is_not_closure(clo)) { \\\n"
" Cyc_apply(td, clo, " n ", buf ); \\\n"
"}"))
(wrap " else { \\\n")
" ((clo)->fn)(td, clo, " n ", buf); \\\n"
;(wrap ";\\\n}")
)))
(wrap ";\\\n}"))))
(define (c-macro-n-prefix n prefix)
(if (> n 0)