[svn:parrot] r40766 - in branches/context_pmc3/src: . ops pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Mon Aug 24 22:11:51 UTC 2009


Author: bacek
Date: Mon Aug 24 22:11:51 2009
New Revision: 40766
URL: https://trac.parrot.org/parrot/changeset/40766

Log:
Use Parrot_cx_get|set_namespace accessors.

Modified:
   branches/context_pmc3/src/global.c
   branches/context_pmc3/src/global_setup.c
   branches/context_pmc3/src/ops/var.ops
   branches/context_pmc3/src/pmc.c
   branches/context_pmc3/src/pmc/exporter.pmc
   branches/context_pmc3/src/pmc/parrotinterpreter.pmc
   branches/context_pmc3/src/pmc/sub.pmc

Modified: branches/context_pmc3/src/global.c
==============================================================================
--- branches/context_pmc3/src/global.c	Mon Aug 24 22:11:24 2009	(r40765)
+++ branches/context_pmc3/src/global.c	Mon Aug 24 22:11:51 2009	(r40766)
@@ -375,7 +375,7 @@
     ASSERT_ARGS(Parrot_make_namespace_autobase)
     PMC *base_ns;
     if (VTABLE_isa(interp, key, CONST_STRING(interp, "String")))
-        base_ns = CURRENT_CONTEXT_FIELD(interp, current_namespace);
+        base_ns = Parrot_cx_get_namespace(interp, CONTEXT(interp));
     else
         base_ns = VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace,
             CURRENT_CONTEXT_FIELD(interp, current_HLL));
@@ -531,7 +531,7 @@
 Parrot_find_global_cur(PARROT_INTERP, ARGIN_NULLOK(STRING *globalname))
 {
     ASSERT_ARGS(Parrot_find_global_cur)
-    PMC * const ns = CURRENT_CONTEXT_FIELD(interp, current_namespace);
+    PMC * const ns = Parrot_cx_get_namespace(interp, CONTEXT(interp));
     return Parrot_find_global_n(interp, ns, globalname);
 }
 

Modified: branches/context_pmc3/src/global_setup.c
==============================================================================
--- branches/context_pmc3/src/global_setup.c	Mon Aug 24 22:11:24 2009	(r40765)
+++ branches/context_pmc3/src/global_setup.c	Mon Aug 24 22:11:51 2009	(r40766)
@@ -215,8 +215,8 @@
     interp->root_namespace = pmc_new(interp, enum_class_NameSpace);
     Parrot_init_HLL(interp);
 
-    CURRENT_CONTEXT_FIELD(interp, current_namespace) =
-        VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace, 0);
+    Parrot_cx_set_namespace(interp, CONTEXT(interp),
+        VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace, 0));
 
     /* We need a class hash */
     interp->class_hash = classname_hash = pmc_new(interp, enum_class_NameSpace);

Modified: branches/context_pmc3/src/ops/var.ops
==============================================================================
--- branches/context_pmc3/src/ops/var.ops	Mon Aug 24 22:11:24 2009	(r40765)
+++ branches/context_pmc3/src/ops/var.ops	Mon Aug 24 22:11:51 2009	(r40766)
@@ -130,12 +130,12 @@
 =cut
 
 op get_namespace(out PMC) {
-    PMC * const cur_ns = CURRENT_CONTEXT_FIELD(interp, current_namespace);
+    PMC * const cur_ns = Parrot_cx_get_namespace(interp, CONTEXT(interp));
     $1 = cur_ns;
 }
 
 op get_namespace(out PMC, in PMC) {
-    PMC * const cur_ns = CURRENT_CONTEXT_FIELD(interp, current_namespace);
+    PMC * const cur_ns = Parrot_cx_get_namespace(interp, CONTEXT(interp));
     PMC * const ns     = Parrot_get_namespace_keyed(interp, cur_ns, $2);
 
     $1 = PMC_IS_NULL(ns) ? PMCNULL : ns;
@@ -218,12 +218,12 @@
 =cut
 
 op get_global(out PMC, in STR) {
-    PMC * const cur_ns = CURRENT_CONTEXT_FIELD(interp, current_namespace);
+    PMC * const cur_ns = Parrot_cx_get_namespace(interp, CONTEXT(interp));
     $1 = Parrot_find_global_op(interp, cur_ns, $2, expr NEXT());
 }
 
 op get_global(out PMC, in PMC, in STR) {
-    PMC * const cur_ns = CURRENT_CONTEXT_FIELD(interp, current_namespace);
+    PMC * const cur_ns = Parrot_cx_get_namespace(interp, CONTEXT(interp));
     if (PMC_IS_NULL(cur_ns)) {
         $1 = PMCNULL;
     }
@@ -322,12 +322,12 @@
 =cut
 
 op set_global(in STR, invar PMC) {
-    PMC * const cur_ns = CURRENT_CONTEXT_FIELD(interp, current_namespace);
+    PMC * const cur_ns = Parrot_cx_get_namespace(interp, CONTEXT(interp));
     Parrot_set_global(interp, cur_ns, $1, $2);
 }
 
 op set_global(in PMC, in STR, invar PMC) {
-    PMC * const cur_ns = CURRENT_CONTEXT_FIELD(interp, current_namespace);
+    PMC * const cur_ns = Parrot_cx_get_namespace(interp, CONTEXT(interp));
     PMC * const ns     = Parrot_make_namespace_keyed(interp, cur_ns, $1);
 
     Parrot_set_global(interp, ns, $2, $3);

Modified: branches/context_pmc3/src/pmc.c
==============================================================================
--- branches/context_pmc3/src/pmc.c	Mon Aug 24 22:11:24 2009	(r40765)
+++ branches/context_pmc3/src/pmc.c	Mon Aug 24 22:11:51 2009	(r40766)
@@ -842,7 +842,7 @@
 
             /* anchor at parent, aka current_namespace, that is 'parrot' */
             VTABLE_set_pmc_keyed_str(interp,
-                    CURRENT_CONTEXT_FIELD(interp, current_namespace), class_name, ns);
+                    Parrot_cx_get_namespace(interp, CONTEXT(interp)), class_name, ns);
         }
 
         _class = vtable->pmc_class;

Modified: branches/context_pmc3/src/pmc/exporter.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/exporter.pmc	Mon Aug 24 22:11:24 2009	(r40765)
+++ branches/context_pmc3/src/pmc/exporter.pmc	Mon Aug 24 22:11:51 2009	(r40766)
@@ -109,7 +109,7 @@
     VTABLE void init() {
         /* Set up the object. */
         SET_ATTR_ns_src(INTERP, SELF, PMCNULL);
-        SET_ATTR_ns_dest(INTERP, SELF, CURRENT_CONTEXT_FIELD(INTERP, current_namespace));
+        SET_ATTR_ns_dest(INTERP, SELF, Parrot_cx_get_namespace(INTERP, CONTEXT(INTERP)));
         SET_ATTR_globals(INTERP, SELF, PMCNULL);
 
         /* Set flags for custom GC mark and destroy. */

Modified: branches/context_pmc3/src/pmc/parrotinterpreter.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/parrotinterpreter.pmc	Mon Aug 24 22:11:24 2009	(r40765)
+++ branches/context_pmc3/src/pmc/parrotinterpreter.pmc	Mon Aug 24 22:11:51 2009	(r40766)
@@ -520,7 +520,7 @@
         s = CONST_STRING(interp, "namespace");
 
         if (Parrot_str_equal(interp, item, s))
-            return CONTEXT_FIELD(interp, ctx, current_namespace);
+            return Parrot_cx_get_namespace(interp, ctx);
 
         s = CONST_STRING(interp, "continuation");
 

Modified: branches/context_pmc3/src/pmc/sub.pmc
==============================================================================
--- branches/context_pmc3/src/pmc/sub.pmc	Mon Aug 24 22:11:24 2009	(r40765)
+++ branches/context_pmc3/src/pmc/sub.pmc	Mon Aug 24 22:11:51 2009	(r40766)
@@ -310,7 +310,7 @@
         }
 
         CONTEXT_FIELD(interp, context, current_HLL)       = sub->HLL_id;
-        CONTEXT_FIELD(interp, context, current_namespace) = sub->namespace_stash;
+        Parrot_cx_set_namespace(interp, context, sub->namespace_stash);
 
         /* create pad if needed
          * TODO move this up in front of argument passing


More information about the parrot-commits mailing list