From fa76b0b589d6483a20049cc33220c27bb5413a1c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 19 Nov 2017 22:42:06 -0800 Subject: 4132 Simplify the implementation of calling continuations. Since we don't support next-ingredient on continuations, might as well not bother with all that call housekeeping for ingredients. --- 076continuation.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to '076continuation.cc') diff --git a/076continuation.cc b/076continuation.cc index 4b938c62..e3a84a51 100644 --- a/076continuation.cc +++ b/076continuation.cc @@ -211,7 +211,6 @@ if (is_mu_continuation(current_instruction().ingredients.at(0))) { if (!contains_key(Delimited_continuation, ingredients.at(0).at(0))) raise << maybe(current_recipe_name()) << "no such delimited continuation " << current_instruction().ingredients.at(0).original_string << '\n' << end(); const call_stack& new_frames = get(Delimited_continuation, ingredients.at(0).at(0)).frames; - const call& caller = (SIZE(new_frames) > 1) ? *++new_frames.begin() : Current_routine->calls.front(); for (call_stack::const_reverse_iterator p = new_frames.rbegin(); p != new_frames.rend(); ++p) { Current_routine->calls.push_front(*p); // ensure that the presence of a continuation keeps its stack frames from being reclaimed @@ -222,9 +221,8 @@ if (is_mu_continuation(current_instruction().ingredients.at(0))) { trace("trace") << "calling delimited continuation; growing callstack depth to " << Trace_stream->callstack_depth << end(); assert(Trace_stream->callstack_depth < 9000); // 9998-101 plus cushion } - ingredients.erase(ingredients.begin()); // drop the callee - finish_call_housekeeping(to_instruction(caller), ingredients); - copy(ingredients.begin(), ingredients.end(), inserter(products, products.begin())); + // no call housekeeping; continuations don't support next-ingredient + copy(/*drop continuation*/++ingredients.begin(), ingredients.end(), inserter(products, products.begin())); break; // record results of resuming 'return-continuation-until-mark' instruction } -- cgit 1.4.1-2-gfad0