This commit is contained in:
Justin Ethier 2018-10-11 18:49:40 -04:00
parent b7b844b16e
commit 390be44b2c

View file

@ -2808,7 +2808,7 @@ if (type_is_pair_prim(clo)) { \
Cyc_apply(td, 0, (closure)(a1), clo); \ Cyc_apply(td, 0, (closure)(a1), clo); \
} else if((clo)->pc) { \ } else if((clo)->pc) { \
object buf[1]; buf[0] = a1;\ object buf[1]; buf[0] = a1;\
((gc_thread_data *)td)->args = &buf; \ ((gc_thread_data *)td)->args = buf; \
((gc_thread_data *)td)->pc = (clo)->pc; \ ((gc_thread_data *)td)->pc = (clo)->pc; \
((clo)->fn)(td, 1);\ ((clo)->fn)(td, 1);\
} else { \ } else { \
@ -2852,7 +2852,7 @@ if (type_is_pair_prim(clo)) { \
Cyc_apply(td, 1, (closure)(a1), clo,a2); \ Cyc_apply(td, 1, (closure)(a1), clo,a2); \
} else if((clo)->pc) { \ } else if((clo)->pc) { \
object buf[2]; buf[0] = a1;buf[1] = a2; \ object buf[2]; buf[0] = a1;buf[1] = a2; \
((gc_thread_data *)td)->args = &buf; \ ((gc_thread_data *)td)->args = buf; \
((gc_thread_data *)td)->pc = (clo)->pc; \ ((gc_thread_data *)td)->pc = (clo)->pc; \
((clo)->fn)(td, 2);\ ((clo)->fn)(td, 2);\
} else { \ } else { \
@ -3120,6 +3120,12 @@ static void __host_lambda_1(void *data, int argc) {
while(1) { while(1) {
top = alloca(sizeof(object)); // TODO: is there a more efficient way? top = alloca(sizeof(object)); // TODO: is there a more efficient way?
// TODO:
// if (stack_overflow(&top, (((gc_thread_data *)data)->stack_limit))) {
// mclosure0(c1, (function_type) __host_lambda_1);
// GC(data, &c1, buf, ?);
// return;
// }
// TODO: if exceeded stack limit, initiate minor GC // TODO: if exceeded stack limit, initiate minor GC
// bundle up args, pc, and pass them along // bundle up args, pc, and pass them along