From 8ae1ec2f2ae2cfda1ecdd250e67f8542fd6f321b Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 29 Apr 2016 11:22:04 -0700 Subject: [PATCH] microcode/pruxffi.c: Punt problem callout optimization. --- src/microcode/pruxffi.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/microcode/pruxffi.c b/src/microcode/pruxffi.c index e03abe33b..37e325934 100644 --- a/src/microcode/pruxffi.c +++ b/src/microcode/pruxffi.c @@ -508,13 +508,18 @@ callout_continue (CalloutTrampIn tramp) /* Re-seal the CStack frame over the C results (again, pushing the cstack_depth and callout-part2) and abort. Restart as C-CALL-CONTINUE and run callout-part2. */ - SCM val; - CSTACK_PUSH (int, cstack_depth); CSTACK_PUSH (CalloutTrampIn, tramp); +#if 1 + PRIMITIVE_ABORT (PRIM_POP_RETURN); + /* NOTREACHED */ +#else /* Just call; do not actually abort. */ - /* PRIMITIVE_ABORT (PRIM_POP_RETURN); */ + + /* This is fubared by a GC during a callback. callback_run_kernel + probably needs to use something like apply_compiled_from_ + primitive for this to work... */ /* Remove stack sealant created by callout_seal (which used back_out_of_primitive), as if removed by pop_return in Interp() @@ -527,8 +532,8 @@ callout_continue (CalloutTrampIn tramp) SET_EXP (APPLY_FRAME_PROCEDURE ()); /* APPLY_PRIMITIVE_FROM_INTERPRETER (Function); */ /* Prim_c_call_continue(); */ - val = tramp (); - return (val); + return (tramp ()); +#endif } DEFINE_PRIMITIVE ("C-CALL-CONTINUE", Prim_c_call_continue, 1, LEXPR, 0) @@ -570,7 +575,7 @@ callout_lunseal (CalloutTrampIn expected) CSTACK_LPOP (int, depth, tos); if (depth != cstack_depth || found != expected) { - outf_error_line ("\ninternal error: slipped in 1st part of callout"); + outf_error_line ("\ninternal error: slipped in 2nd tramp of callout"); signal_error_from_primitive (ERR_EXTERNAL_RETURN); } return (tos); -- 2.25.1