Author: leo
Date: Mon Mar 13 04:50:30 2006
New Revision: 11883

Modified:
   trunk/src/ops/experimental.ops
   trunk/src/pmc/coroutine.pmc
   trunk/src/pmc/sub.pmc

Log:
Namespaces 20 - current_namespace

* set ctx->current_namespace on Sub invocation
* use it in the get_namespace opcode


Modified: trunk/src/ops/experimental.ops
==============================================================================
--- trunk/src/ops/experimental.ops      (original)
+++ trunk/src/ops/experimental.ops      Mon Mar 13 04:50:30 2006
@@ -249,8 +249,7 @@
 
 op get_namespace(out PMC) {
     PMC *current_sub;
-    current_sub = CONTEXT(interpreter->ctx)->current_sub;
-    $1 = PMC_sub(current_sub)->namespace_stash;
+    $1 = CONTEXT(interpreter->ctx)->current_namespace;
     goto NEXT();
 }
 

Modified: trunk/src/pmc/coroutine.pmc
==============================================================================
--- trunk/src/pmc/coroutine.pmc (original)
+++ trunk/src/pmc/coroutine.pmc Mon Mar 13 04:50:30 2006
@@ -161,6 +161,7 @@
             PMC_cont(ccont)->from_ctx = ctx;
             ctx->current_sub = SELF;
             ctx->current_HLL = co->HLL_id;
+            ctx->current_namespace = co->namespace_stash;
             ctx->current_cont = ccont;
             ctx->current_object = NULL;
             INTERP->current_object = NULL;

Modified: trunk/src/pmc/sub.pmc
==============================================================================
--- trunk/src/pmc/sub.pmc       (original)
+++ trunk/src/pmc/sub.pmc       Mon Mar 13 04:50:30 2006
@@ -326,6 +326,7 @@
             INTERP->current_method = NULL;
         }
         context->current_HLL = sub->HLL_id;
+        context->current_namespace = sub->namespace_stash;
         /* create pad if needed
          * TODO move this up in front of argument passing
          *      and factor out common code with coroutine pmc

Reply via email to