[svn:parrot] r42940 - trunk/compilers/imcc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Tue Dec 8 08:59:37 UTC 2009


Author: chromatic
Date: Tue Dec  8 08:59:34 2009
New Revision: 42940
URL: https://trac.parrot.org/parrot/changeset/42940

Log:
[IMCC] Delayed running :immediate subs when writing PBC and made reading PBC
always run :immediate subs, so that type mapping and subclassing and other
operations which depend on :immediate-time information (such as type numbers)
are constant and sane at least within individual PBC files.
This should make .const work much better for PBC.

Modified:
   trunk/compilers/imcc/main.c
   trunk/compilers/imcc/pbc.c

Modified: trunk/compilers/imcc/main.c
==============================================================================
--- trunk/compilers/imcc/main.c	Tue Dec  8 08:53:37 2009	(r42939)
+++ trunk/compilers/imcc/main.c	Tue Dec  8 08:59:34 2009	(r42940)
@@ -785,6 +785,7 @@
         IMCC_info(interp, 1, "Running...\n");
 
     /* runs :init functions */
+    PackFile_fixup_subs(interp, PBC_IMMEDIATE, NULL);
     PackFile_fixup_subs(interp, PBC_MAIN, NULL);
 
     Parrot_runcode(interp, argc, argv);

Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c	Tue Dec  8 08:53:37 2009	(r42939)
+++ trunk/compilers/imcc/pbc.c	Tue Dec  8 08:59:34 2009	(r42940)
@@ -1990,6 +1990,9 @@
     if (!unit->instructions)
         return 0;
 
+    if (IMCC_INFO(interp)->write_pbc)
+        return 0;
+
     /*
      * if the sub was marked IMMEDIATE, we run it now
      * This is *dangerous*: all possible global state can be messed


More information about the parrot-commits mailing list