Author: leo
Date: Tue Oct 11 09:49:24 2005
New Revision: 9458

Modified:
   trunk/PBC_COMPAT
   trunk/classes/sub.pmc
   trunk/imcc/pbc.c
   trunk/t/native_pbc/integer.t
   trunk/t/native_pbc/number.t
Log:
Variable-sized reg frames 3a - store/freeze/thaw reg counts

* this patches changes the Sub layout of PBCs, therefore:
* update PBC_COMPAT, disable native test

please:
make realclean ; find . -name '*.pbc' | xargs rm


Modified: trunk/PBC_COMPAT
==============================================================================
--- trunk/PBC_COMPAT    (original)
+++ trunk/PBC_COMPAT    Tue Oct 11 09:49:24 2005
@@ -24,6 +24,7 @@
 
 # please insert tab separated entries at the top of the list
 
+2005.10.11     leo     added reg usage to Subs in PBC
 2005.10.07     leo     deleted lot of opcodes
 2005.10.05     leo     deleted rx_ opcodes
 2005.10.01     leo     0.3.0 release

Modified: trunk/classes/sub.pmc
==============================================================================
--- trunk/classes/sub.pmc       (original)
+++ trunk/classes/sub.pmc       Tue Oct 11 09:49:24 2005
@@ -458,6 +458,7 @@ Archives the subroutine.
         IMAGE_IO *io = info->image_io;
         struct Parrot_sub * sub = PMC_sub(SELF);
         size_t start_offs, end_offs;
+        int i;
 
         SUPER(info);
         /*
@@ -470,6 +471,7 @@ Archives the subroutine.
          * - name_space
          * - HLL_id
          * - multi_signature
+         * - n_regs_used[i]
          */
 
         /*
@@ -491,6 +493,8 @@ Archives the subroutine.
                 PObj_get_FLAGS(pmc) & SUB_FLAG_PF_MASK);
         io->vtable->push_string(INTERP, io, sub->name);
         io->vtable->push_integer(INTERP, io, sub->HLL_id);
+        for (i = 0; i < 4; ++i)
+            io->vtable->push_integer(INTERP, io, sub->n_regs_used[i]);
     }
 
 /*
@@ -511,6 +515,7 @@ Unarchives the subroutine.
             struct Parrot_sub * sub = PMC_sub(SELF);
             size_t start_offs, end_offs;
             INTVAL flags;
+            int i;
             /*
              * we get relative offsets
              */
@@ -523,6 +528,8 @@ Unarchives the subroutine.
             PObj_get_FLAGS(SELF) |= flags & SUB_FLAG_PF_MASK;
             sub->name = io->vtable->shift_string(INTERP, io);
             sub->HLL_id  = io->vtable->shift_integer(INTERP, io);
+            for (i = 0; i < 4; ++i)
+                sub->n_regs_used[i] = io->vtable->shift_integer(INTERP, io);
         }
     }
 

Modified: trunk/imcc/pbc.c
==============================================================================
--- trunk/imcc/pbc.c    (original)
+++ trunk/imcc/pbc.c    Tue Oct 11 09:49:24 2005
@@ -646,7 +646,7 @@ static int
 add_const_pmc_sub(Interp *interpreter, SymReg *r,
         int offs, int end)
 {
-    int k;
+    int i, k;
     INTVAL type;
     PMC *name_space;
     PMC *sub_pmc;
@@ -711,6 +711,8 @@ add_const_pmc_sub(Interp *interpreter, S
     sub->address = (opcode_t*)(long)offs;
     sub->end = (opcode_t*)(long)end;
     sub->HLL_id = unit->HLL_id;
+    for (i = 0; i < 4; ++i)
+        sub->n_regs_used[i] = unit->n_regs_used[i];
     /*
      * check if it's declared multi
      */

Modified: trunk/t/native_pbc/integer.t
==============================================================================
--- trunk/t/native_pbc/integer.t        (original)
+++ trunk/t/native_pbc/integer.t        Tue Oct 11 09:49:24 2005
@@ -36,7 +36,9 @@ should be included for reference.
 
 =cut
 
-use Parrot::Test tests => 1;
+use Parrot::Test;
+# tests => 1;
+ plan  skip_all => 'Ongoing PBC format changes';
 
 # execute the file t/native_pbc/integer_1.pbc
 #

Modified: trunk/t/native_pbc/number.t
==============================================================================
--- trunk/t/native_pbc/number.t (original)
+++ trunk/t/native_pbc/number.t Tue Oct 11 09:49:24 2005
@@ -37,7 +37,9 @@ $ mv n.pbc t/native_pbc/number_$(N).pbc
 
 =cut
 
-use Parrot::Test tests => 1;
+# use Parrot::Test tests => 1;
+use Parrot::Test;
+ plan  skip_all => 'Ongoing PBC format changes';
 
 my $output = << 'END_OUTPUT';
 1.000000

Reply via email to