about summary refs log tree commit diff stats
path: root/020run.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-11-06 01:12:42 -0800
committerKartik K. Agaram <vc@akkartik.com>2017-11-06 01:12:42 -0800
commit3b776ac3843e925ee24f49e8df51ab6a1db6c085 (patch)
tree91bd75152023b6144d3af8c8e8e37a57cfb6867f /020run.cc
parentc34a067564e2005a590bfd8730c90fed51cbb2c2 (diff)
downloadmu-3b776ac3843e925ee24f49e8df51ab6a1db6c085.tar.gz
4116 - support calling continuations with arguments
Surprisingly small change, considering how long it took me and how
mind-bending it was. 'return-continuation-until-mark' now behaves like
both call and return instructions, which made it hard to reason about.
Diffstat (limited to '020run.cc')
-rw-r--r--020run.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/020run.cc b/020run.cc
index 0da9fba7..b94d274a 100644
--- a/020run.cc
+++ b/020run.cc
@@ -64,6 +64,7 @@ void run_current_routine() {
     // Running One Instruction
     if (current_instruction().is_label) { ++current_step_index();  continue; }
     trace(Initial_callstack_depth + Trace_stream->callstack_depth, "run") << to_string(current_instruction()) << end();
+//?     if (Foo) cerr << "run: " << to_string(current_instruction()) << '\n';
     if (get_or_insert(Memory, 0) != 0) {
       raise << "something wrote to location 0; this should never happen\n" << end();
       put(Memory, 0, 0);
@@ -323,6 +324,7 @@ void write_memory(reagent/*copy*/ x, const vector<double>& data) {
   for (int offset = 0;  offset < SIZE(data);  ++offset) {
     assert(x.value+offset > 0);
     trace("mem") << "storing " << no_scientific(data.at(offset)) << " in location " << x.value+offset << end();
+//?     if (Foo) cerr << "mem: storing " << no_scientific(data.at(offset)) << " in location " << x.value+offset << '\n';
     put(Memory, x.value+offset, data.at(offset));
   }
 }