develooper Front page | perl.cvs.mod_parrot | Postings from August 2009

[svn:mod_parrot] r654 - mod_parrot/branches/configure-jeff/src

From:
jhorwitz
Date:
August 29, 2009 08:47
Subject:
[svn:mod_parrot] r654 - mod_parrot/branches/configure-jeff/src
Message ID:
20090829154715.447381844E2@xx12.develooper.com
Author: jhorwitz
Date: Sat Aug 29 08:47:14 2009
New Revision: 654

Modified:
   mod_parrot/branches/configure-jeff/src/mod_parrot.c
   mod_parrot/branches/configure-jeff/src/parrot_util.c

Log:
merge r652, r653 from trunk


Modified: mod_parrot/branches/configure-jeff/src/mod_parrot.c
==============================================================================
--- mod_parrot/branches/configure-jeff/src/mod_parrot.c	(original)
+++ mod_parrot/branches/configure-jeff/src/mod_parrot.c	Sat Aug 29 08:47:14 2009
@@ -361,7 +361,7 @@
     ctx_class = Parrot_oo_get_class(interp, namespace);
     Parrot_unregister_pmc(interp, namespace);
 
-    ctx_pmc = VTABLE_instantiate(interp, ctx_class, PMCNULL);
+    ctx_pmc = Parrot_PMC_instantiate(interp, ctx_class, PMCNULL);
     Parrot_register_pmc(interp, ctx_pmc);
 
     if (!hll) hll = MODPARROT_DEFAULT_HLL;

Modified: mod_parrot/branches/configure-jeff/src/parrot_util.c
==============================================================================
--- mod_parrot/branches/configure-jeff/src/parrot_util.c	(original)
+++ mod_parrot/branches/configure-jeff/src/parrot_util.c	Sat Aug 29 08:47:14 2009
@@ -47,18 +47,24 @@
 static Parrot_PMC get_sub_pmc_k(Parrot_Interp interp, char *hll, char *name)
 {
     Parrot_PMC sub;
+    Parrot_PMC nskey;
     Parrot_PMC namespace;
     int typenum;
 
     typenum = Parrot_PMC_typenum(interp, "ResizablePMCArray");
-    namespace = (Parrot_PMC)Parrot_PMC_new(interp, typenum);
+    nskey = (Parrot_PMC)Parrot_PMC_new(interp, typenum);
+    Parrot_register_pmc(interp, nskey);
+    Parrot_PMC_set_intval(interp, nskey, 3);
+    Parrot_PMC_set_cstring_intkey(interp, nskey, 0, "ModParrot");
+    Parrot_PMC_set_cstring_intkey(interp, nskey, 1, "HLL");
+    Parrot_PMC_set_cstring_intkey(interp, nskey, 2, hll);
+
+    /* this assumes no current HLL */
+    namespace = Parrot_get_namespace_keyed(interp,
+        Parrot_get_ctx_HLL_namespace(interp), nskey);
     Parrot_register_pmc(interp, namespace);
-    Parrot_PMC_set_intval(interp, namespace, 3);
-    Parrot_PMC_set_cstring_intkey(interp, namespace, 0, "ModParrot");
-    Parrot_PMC_set_cstring_intkey(interp, namespace, 1, "HLL");
-    Parrot_PMC_set_cstring_intkey(interp, namespace, 2, hll);
 
-    sub = Parrot_find_global_k(interp, namespace, MAKE_PARROT_STRING(name));
+    sub = Parrot_find_global_n(interp, namespace, MAKE_PARROT_STRING(name));
 
     Parrot_unregister_pmc(interp, namespace);
 
@@ -137,30 +143,38 @@
     Parrot_PMC namespace;
     Parrot_PMC hllns;
     Parrot_PMC ourns;
+    Parrot_PMC nskey;
     int typenum, hllid;
 
     typenum = Parrot_PMC_typenum(interp, "ResizablePMCArray");
-    ourns = (Parrot_PMC)Parrot_PMC_new(interp, typenum);
+    nskey = (Parrot_PMC)Parrot_PMC_new(interp, typenum);
+    Parrot_register_pmc(interp, nskey);
+    Parrot_PMC_set_intval(interp, nskey, 3);
+    Parrot_PMC_set_cstring_intkey(interp, nskey, 0, "ModParrot");
+    Parrot_PMC_set_cstring_intkey(interp, nskey, 1, "HLL");
+    Parrot_PMC_set_cstring_intkey(interp, nskey, 2, hll);
+
+    /* this assumes no current HLL */
+    ourns = Parrot_get_namespace_keyed(interp,
+        Parrot_get_ctx_HLL_namespace(interp), nskey);
     Parrot_register_pmc(interp, ourns);
-    Parrot_PMC_set_intval(interp, ourns, 3);
-    Parrot_PMC_set_cstring_intkey(interp, ourns, 0, "ModParrot");
-    Parrot_PMC_set_cstring_intkey(interp, ourns, 1, "HLL");
-    Parrot_PMC_set_cstring_intkey(interp, ourns, 2, hll);
 
     /* if PIR, use default namespace, else look in HLL namespace */
     if (!strcmp(hll, "PIR")) {
         namespace = ourns;
-        sub = Parrot_find_global_k(interp, namespace, MAKE_PARROT_STRING(name));
+        sub = Parrot_find_global_n(interp, namespace, MAKE_PARROT_STRING(name));
     }
     else {
         /* XXX cache these during module creation */
         hllid = Parrot_get_HLL_id(interp, MAKE_PARROT_STRING(hll));
         hllns = Parrot_get_HLL_namespace(interp, hllid);
-        namespace = Parrot_get_namespace_keyed(interp, hllns, ourns);
+        namespace = Parrot_get_namespace_keyed(interp, hllns, nskey);
         sub = Parrot_find_global_n(interp, namespace, MAKE_PARROT_STRING(name));
     }
 
+    Parrot_unregister_pmc(interp, nskey);
     Parrot_unregister_pmc(interp, namespace);
+    Parrot_unregister_pmc(interp, ourns);
 
     return(sub);
 }
@@ -313,10 +327,10 @@
         Parrot_PMC_set_pmc_keyed_str(interp, init,
             Parrot_str_new(interp, init_key, strlen(init_key)),
                 pointer_pmc);
-        obj = VTABLE_instantiate(interp, _class, init);
+        obj = Parrot_PMC_instantiate(interp, _class, init);
     }
     else {
-        obj = VTABLE_instantiate(interp, _class, PMCNULL);
+        obj = Parrot_PMC_instantiate(interp, _class, PMCNULL);
     }
     Parrot_unregister_pmc(interp, init);
     Parrot_unregister_pmc(interp, _class);



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About