[svn:parrot] r41115 - trunk/src

NotFound at svn.parrot.org NotFound at svn.parrot.org
Mon Sep 7 15:35:05 UTC 2009


Author: NotFound
Date: Mon Sep  7 15:35:04 2009
New Revision: 41115
URL: https://trac.parrot.org/parrot/changeset/41115

Log:
[core] load bytecode and dynops in HLL 'parrot' conext, TT #150

Modified:
   trunk/src/dynext.c
   trunk/src/packfile.c

Modified: trunk/src/dynext.c
==============================================================================
--- trunk/src/dynext.c	Mon Sep  7 15:20:28 2009	(r41114)
+++ trunk/src/dynext.c	Mon Sep  7 15:35:04 2009	(r41115)
@@ -428,6 +428,13 @@
     void (*init_func)(PARROT_INTERP, PMC *);
     PMC *lib_pmc;
 
+    INTVAL regs_used[] = { 2, 2, 2, 2 }; /* Arbitrary values */
+    const int parrot_hll_id = 0;
+    PMC * context = Parrot_push_context(interp, regs_used);
+    Parrot_pcc_set_HLL(interp, context, parrot_hll_id);
+    Parrot_pcc_set_namespace(interp, context,
+            Parrot_get_HLL_namespace(interp, parrot_hll_id));
+
     /*
      * work around gcc 3.3.3 and other problem with dynpmcs
      * something during library loading doesn't stand a GC run
@@ -475,6 +482,8 @@
     /* UNLOCK */
     Parrot_unblock_GC_mark(interp);
 
+    Parrot_pop_context(interp);
+
     return lib_pmc;
 }
 

Modified: trunk/src/packfile.c
==============================================================================
--- trunk/src/packfile.c	Mon Sep  7 15:20:28 2009	(r41114)
+++ trunk/src/packfile.c	Mon Sep  7 15:35:04 2009	(r41115)
@@ -4711,6 +4711,13 @@
     ASSERT_ARGS(compile_or_load_file)
     char * const filename = Parrot_str_to_cstring(interp, path);
 
+    INTVAL regs_used[] = { 2, 2, 2, 2 }; /* Arbitrary values */
+    const int parrot_hll_id = 0;
+    PMC * context = Parrot_push_context(interp, regs_used);
+    Parrot_pcc_set_HLL(interp, context, parrot_hll_id);
+    Parrot_pcc_set_namespace(interp, context,
+            Parrot_get_HLL_namespace(interp, parrot_hll_id));
+
     if (file_type == PARROT_RUNTIME_FT_PBC) {
         PackFile * const pf = PackFile_append_pbc(interp, filename);
         Parrot_str_free_cstring(filename);
@@ -4738,6 +4745,8 @@
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
                 "compiler returned NULL ByteCode '%Ss' - %Ss", path, err);
     }
+
+    Parrot_pop_context(interp);
 }
 
 /*


More information about the parrot-commits mailing list