[Quipu-dev] quipu/quipu: Implement continuation updating

Back to archive index

scmno****@osdn***** scmno****@osdn*****
Wed Jun 20 00:34:40 JST 2018


changeset 3162caa55d5c in quipu/quipu
details: http://hg.osdn.jp/view/quipu/quipu?cmd=changeset;node=3162caa55d5c
user: Agustina Arzille <avarz****@riseu*****>
date: Tue Jun 19 12:34:31 2018 -0300
description: Implement continuation updating

diffstat:

 compiler.cpp |  12 +++++++++++-
 interp.cpp   |   1 +
 2 files changed, 12 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r aac0a6b9274b -r 3162caa55d5c compiler.cpp
--- a/compiler.cpp	Tue Jun 19 04:17:04 2018 +0000
+++ b/compiler.cpp	Tue Jun 19 12:34:31 2018 -0300
@@ -2718,7 +2718,17 @@
     OP_(MKCONT):
       {
         interp->pop ();
-        continuation *p = as_continuation (continuation::make (interp, lastf));
+        continuation *p;
+
+        if (cont != UNBOUND)
+          { // Update current continuation.
+            p = as_continuation (cont);
+            p->argv = interp->stkobj;
+            p->sframes[1] = interp->cur_frame;
+          }
+        else
+          p = as_continuation (continuation::make (interp, lastf));
+
         sx = *ip++;
 
         p->ip_offset = sx + (ip -
diff -r aac0a6b9274b -r 3162caa55d5c interp.cpp
--- a/interp.cpp	Tue Jun 19 04:17:04 2018 +0000
+++ b/interp.cpp	Tue Jun 19 12:34:31 2018 -0300
@@ -97,6 +97,7 @@
   object ns = alloc_array (this, size = upsize (size), UNBOUND);
   memcpy (&xaref(ns, 0), this->stack, sp * sizeof (object));
 
+  this->stkobj = ns;
   this->stack = &xaref(ns, 0);
   this->stkend = this->stack + sp;
   this->call_hooks (HOOK_TYPE_STKMOV);




More information about the Quipu-dev mailing list
Back to archive index