[svn:parrot] r43097 - branches/context_unify3/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Wed Dec 16 12:55:27 UTC 2009


Author: bacek
Date: Wed Dec 16 12:55:27 2009
New Revision: 43097
URL: https://trac.parrot.org/parrot/changeset/43097

Log:
Resurrect old core to setting caller_ctx in Sub.invoke.

Modified:
   branches/context_unify3/src/pmc/sub.pmc

Modified: branches/context_unify3/src/pmc/sub.pmc
==============================================================================
--- branches/context_unify3/src/pmc/sub.pmc	Wed Dec 16 12:55:06 2009	(r43096)
+++ branches/context_unify3/src/pmc/sub.pmc	Wed Dec 16 12:55:27 2009	(r43097)
@@ -470,8 +470,19 @@
             Parrot_switch_to_cs(INTERP, sub->seg, 1);
 
         if (PObj_get_FLAGS(ccont) & SUB_FLAG_TAILCALL) {
-            Parrot_pcc_dec_recursion_depth(INTERP, context);
-            PObj_get_FLAGS(ccont) &= ~SUB_FLAG_TAILCALL;
+            if (!(*pc == PARROT_OP_get_params_pc
+            ||    (*pc    == PARROT_OP_push_eh_ic
+            &&     pc[2] == PARROT_OP_get_params_pc))) {
+
+                /* TODO keep it or resize it */
+                Parrot_pcc_dec_recursion_depth(INTERP, context);
+
+                PObj_get_FLAGS(ccont) &= ~SUB_FLAG_TAILCALL;
+                /* Weird code to set parent to grand-parent */
+                Parrot_pcc_set_caller_ctx(interp, context,
+                        Parrot_pcc_get_caller_ctx(interp,
+                                Parrot_pcc_get_caller_ctx(interp, context)));
+            }
         }
 
         return pc;


More information about the parrot-commits mailing list