Author: leo
Date: Mon Jul 25 04:53:15 2005
New Revision: 8697

Modified:
   branches/leo-ctx5/ABI_CHANGES
   branches/leo-ctx5/CREDITS
   branches/leo-ctx5/ChangeLog
   branches/leo-ctx5/DEVELOPING
   branches/leo-ctx5/MANIFEST
   branches/leo-ctx5/NEWS
   branches/leo-ctx5/PLATFORMS
   branches/leo-ctx5/README
   branches/leo-ctx5/README.win32
   branches/leo-ctx5/RESPONSIBLE_PARTIES
   branches/leo-ctx5/TODO
   branches/leo-ctx5/classes/eval.pmc
   branches/leo-ctx5/config/gen/makefiles/languages.in
   branches/leo-ctx5/config/gen/makefiles/tcl.in
   branches/leo-ctx5/config/gen/platform/win32/exec.c
   branches/leo-ctx5/docs/ROADMAP
   branches/leo-ctx5/docs/compiler_faq.pod
   branches/leo-ctx5/include/parrot/debug.h
   branches/leo-ctx5/languages/BASIC/interpreter/expr.pasm
   branches/leo-ctx5/languages/LANGUAGES.STATUS
   branches/leo-ctx5/languages/testall
   branches/leo-ctx5/src/packfile.c
   branches/leo-ctx5/src/pmc_freeze.c
   branches/leo-ctx5/t/op/spawnw.t
   branches/leo-ctx5/t/pmc/eval.t
Log:
merge *parts* of -r8677:8696 from trunk

* the rename changes in tcl aren't merged because:
* I got a svn error message
* leo-ctx5 uses already :slurp, while trunk has foldup

Therefore languages/tcl is unaltered


Modified: branches/leo-ctx5/ABI_CHANGES
==============================================================================
--- branches/leo-ctx5/ABI_CHANGES       (original)
+++ branches/leo-ctx5/ABI_CHANGES       Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
 This document describes changes to the Parrot ABI.
 
 2004.11.27 leo

Modified: branches/leo-ctx5/CREDITS
==============================================================================
--- branches/leo-ctx5/CREDITS   (original)
+++ branches/leo-ctx5/CREDITS   Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
        Following in the steps of other open source projects that
        eventually take over the world, here is the partial list
        of people who have contributed to Parrot and its supporting

Modified: branches/leo-ctx5/ChangeLog
==============================================================================
--- branches/leo-ctx5/ChangeLog (original)
+++ branches/leo-ctx5/ChangeLog Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
 2005.07.03    leo
        * Released 0.2.2
        * See NEWS for changes

Modified: branches/leo-ctx5/DEVELOPING
==============================================================================
--- branches/leo-ctx5/DEVELOPING        (original)
+++ branches/leo-ctx5/DEVELOPING        Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
 LAST RELEASE:     Parrot 0.2.2   2005.07.03
 PREVIOUS RELEASE: Parrot 0.2.1   2005.06.04
 

Modified: branches/leo-ctx5/MANIFEST
==============================================================================
--- branches/leo-ctx5/MANIFEST  (original)
+++ branches/leo-ctx5/MANIFEST  Mon Jul 25 04:53:15 2005
@@ -1,3 +1,4 @@
+# $Id$
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
 ABI_CHANGES                                       []
@@ -1344,57 +1345,57 @@ languages/tcl/examples/fact.tcl         
 languages/tcl/examples/hello.tcl                  [tcl]
 languages/tcl/examples/koohii.tcl                 [tcl]
 languages/tcl/examples/power.tcl                  [tcl]
-languages/tcl/lib/commands/append.imc             [tcl]
-languages/tcl/lib/commands/array.imc              [tcl]
-languages/tcl/lib/commands/break.imc              [tcl]
-languages/tcl/lib/commands/catch.imc              [tcl]
-languages/tcl/lib/commands/concat.imc             [tcl]
-languages/tcl/lib/commands/continue.imc           [tcl]
-languages/tcl/lib/commands/error.imc              [tcl]
-languages/tcl/lib/commands/eval.imc               [tcl]
-languages/tcl/lib/commands/exit.imc               [tcl]
-languages/tcl/lib/commands/expr.imc               [tcl]
-languages/tcl/lib/commands/for.imc                [tcl]
-languages/tcl/lib/commands/foreach.imc            [tcl]
-languages/tcl/lib/commands/format.imc             [tcl]
-languages/tcl/lib/commands/global.imc             [tcl]
-languages/tcl/lib/commands/if.imc                 [tcl]
-languages/tcl/lib/commands/join.imc               [tcl]
-languages/tcl/lib/commands/incr.imc               [tcl]
-languages/tcl/lib/commands/info.imc               [tcl]
-languages/tcl/lib/commands/inline.imc             [tcl]
-languages/tcl/lib/commands/lappend.imc            [tcl]
+languages/tcl/lib/commands/append.pir             [tcl]
+languages/tcl/lib/commands/array.pir              [tcl]
+languages/tcl/lib/commands/break.pir              [tcl]
+languages/tcl/lib/commands/catch.pir              [tcl]
+languages/tcl/lib/commands/concat.pir             [tcl]
+languages/tcl/lib/commands/continue.pir           [tcl]
+languages/tcl/lib/commands/error.pir              [tcl]
+languages/tcl/lib/commands/eval.pir               [tcl]
+languages/tcl/lib/commands/exit.pir               [tcl]
+languages/tcl/lib/commands/expr.pir               [tcl]
+languages/tcl/lib/commands/for.pir                [tcl]
+languages/tcl/lib/commands/foreach.pir            [tcl]
+languages/tcl/lib/commands/format.pir             [tcl]
+languages/tcl/lib/commands/global.pir             [tcl]
+languages/tcl/lib/commands/if.pir                 [tcl]
+languages/tcl/lib/commands/join.pir               [tcl]
+languages/tcl/lib/commands/incr.pir               [tcl]
+languages/tcl/lib/commands/info.pir               [tcl]
+languages/tcl/lib/commands/inline.pir             [tcl]
+languages/tcl/lib/commands/lappend.pir            [tcl]
 languages/tcl/lib/commands/lindex.pir             [tcl]
-languages/tcl/lib/commands/linsert.imc            [tcl]
-languages/tcl/lib/commands/list.imc               [tcl]
-languages/tcl/lib/commands/llength.imc            [tcl]
-languages/tcl/lib/commands/lrange.imc             [tcl]
-languages/tcl/lib/commands/lrepeat.imc            [tcl]
-languages/tcl/lib/commands/namespace.imc          [tcl]
+languages/tcl/lib/commands/linsert.pir            [tcl]
+languages/tcl/lib/commands/list.pir               [tcl]
+languages/tcl/lib/commands/llength.pir            [tcl]
+languages/tcl/lib/commands/lrange.pir             [tcl]
+languages/tcl/lib/commands/lrepeat.pir            [tcl]
+languages/tcl/lib/commands/namespace.pir          [tcl]
 languages/tcl/lib/commands/parray.pir             [tcl]
-languages/tcl/lib/commands/proc.imc               [tcl]
-languages/tcl/lib/commands/open.imc               [tcl]
-languages/tcl/lib/commands/puts.imc               [tcl]
-languages/tcl/lib/commands/rename.imc             [tcl]
-languages/tcl/lib/commands/return.imc             [tcl]
-languages/tcl/lib/commands/set.imc                [tcl]
-languages/tcl/lib/commands/source.imc             [tcl]
-languages/tcl/lib/commands/string.imc             [tcl]
-languages/tcl/lib/commands/time.imc               [tcl]
-languages/tcl/lib/commands/unknown.imc            [tcl]
-languages/tcl/lib/commands/unset.imc              [tcl]
-languages/tcl/lib/commands/uplevel.imc            [tcl]
-languages/tcl/lib/commands/upvar.imc              [tcl]
-languages/tcl/lib/commands/while.imc              [tcl]
+languages/tcl/lib/commands/proc.pir               [tcl]
+languages/tcl/lib/commands/open.pir               [tcl]
+languages/tcl/lib/commands/puts.pir               [tcl]
+languages/tcl/lib/commands/rename.pir             [tcl]
+languages/tcl/lib/commands/return.pir             [tcl]
+languages/tcl/lib/commands/set.pir                [tcl]
+languages/tcl/lib/commands/source.pir             [tcl]
+languages/tcl/lib/commands/string.pir             [tcl]
+languages/tcl/lib/commands/time.pir               [tcl]
+languages/tcl/lib/commands/unknown.pir            [tcl]
+languages/tcl/lib/commands/unset.pir              [tcl]
+languages/tcl/lib/commands/uplevel.pir            [tcl]
+languages/tcl/lib/commands/upvar.pir              [tcl]
+languages/tcl/lib/commands/while.pir              [tcl]
 languages/tcl/lib/conversions.pir                 [tcl]
-languages/tcl/lib/expression.imc                  [tcl]
-languages/tcl/lib/get_var.imc                     [tcl]
-languages/tcl/lib/interpret.imc                   [tcl]
-languages/tcl/lib/list.imc                        [tcl]
+languages/tcl/lib/expression.pir                  [tcl]
+languages/tcl/lib/get_var.pir                     [tcl]
+languages/tcl/lib/interpret.pir                   [tcl]
+languages/tcl/lib/list.pir                        [tcl]
 languages/tcl/lib/list_to_string.pir              [tcl]
-languages/tcl/lib/macros/is_space.imc             [tcl]
-languages/tcl/lib/string_to_list.imc              [tcl]
-languages/tcl/lib/tclword.imc                     [tcl]
+languages/tcl/lib/macros/is_space.pir             [tcl]
+languages/tcl/lib/string_to_list.pir              [tcl]
+languages/tcl/lib/tclword.pir                     [tcl]
 languages/tcl/lib/tcl.p6r                         [tcl]
 languages/tcl/lib/variables.pir                   [tcl]
 languages/tcl/t/cmd_append.t                      [tcl]
@@ -1437,8 +1438,8 @@ languages/tcl/t/tcl_misc.t              
 languages/tcl/t/tcl_pir_compiler.t                [tcl]
 languages/tcl/t/tcl_var_subst.t                   [tcl]
 languages/tcl/t/harness                           [tcl]
-languages/tcl/tcl.imc                             [tcl]
-languages/tcl/tcl.imc_template                    [tcl]
+languages/tcl/tcl.pir                             [tcl]
+languages/tcl/tcl.pir_template                    [tcl]
 languages/tcl/tcl.pl                              [tcl]
 languages/tcl/tcl-test.pl                         [tcl]
 languages/testall                                 []

Modified: branches/leo-ctx5/NEWS
==============================================================================
--- branches/leo-ctx5/NEWS      (original)
+++ branches/leo-ctx5/NEWS      Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
 New in 0.2.2
 
 - new call scheme: docs/pdds/pdd03_calling_conventions.pod

Modified: branches/leo-ctx5/PLATFORMS
==============================================================================
--- branches/leo-ctx5/PLATFORMS (original)
+++ branches/leo-ctx5/PLATFORMS Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
 Parrot was reported to compile and run tests successfully on these platforms:
 
 Platform                B8    Runloops      Feature Comp Test Inst YYYYMMDD

Modified: branches/leo-ctx5/README
==============================================================================
--- branches/leo-ctx5/README    (original)
+++ branches/leo-ctx5/README    Mon Jul 25 04:53:15 2005
@@ -3,6 +3,8 @@ This is Parrot, version 0.2.2
 
 Parrot is Copyright (C) 2001-2005 The Perl Foundation. All Rights Reserved.
 
+$Id$
+
 LICENSE INFORMATION
 -------------------
 

Modified: branches/leo-ctx5/README.win32
==============================================================================
--- branches/leo-ctx5/README.win32      (original)
+++ branches/leo-ctx5/README.win32      Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
 This file is best viewed with "perldoc README.win32".
 
 =head1 NAME

Modified: branches/leo-ctx5/RESPONSIBLE_PARTIES
==============================================================================
--- branches/leo-ctx5/RESPONSIBLE_PARTIES       (original)
+++ branches/leo-ctx5/RESPONSIBLE_PARTIES       Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
 This is a partial list of the folks with CVS commit access and the
 areas they're directly responsible for. This does not list all the
 people with CVS commit access, just those who have an area they've

Modified: branches/leo-ctx5/TODO
==============================================================================
--- branches/leo-ctx5/TODO      (original)
+++ branches/leo-ctx5/TODO      Mon Jul 25 04:53:15 2005
@@ -1,3 +1,5 @@
+# $Id$
+
 All TODO items should be documented in RT. (http://rt.perl.org/)
 
 A listing of all TODO items is available at:

Modified: branches/leo-ctx5/classes/eval.pmc
==============================================================================
--- branches/leo-ctx5/classes/eval.pmc  (original)
+++ branches/leo-ctx5/classes/eval.pmc  Mon Jul 25 04:53:15 2005
@@ -134,14 +134,82 @@ for writing to disc and later loading vi
         if (seg->fixups)
             PackFile_add_segment(INTERP, &pf->directory,
                     (struct PackFile_Segment *)seg->fixups);
+        if (seg->pic_index)
+            PackFile_add_segment(INTERP, &pf->directory,
+                    (struct PackFile_Segment *)seg->pic_index);
         size = PackFile_pack_size(INTERP, pf) * sizeof(opcode_t);
         res = string_make_empty(INTERP, enum_stringrep_one, size);
         res->strlen = res->bufused = size;
         PackFile_pack(INTERP, pf, res->strstart);
-        /* XXX leak the pf */
+        /* now remove all segments from directory again and destroy
+         * the packfile
+         */
+        pf->directory.num_segments = 0;
+        PackFile_destroy(INTERP, pf);
         return res;
     }
 
+/*
+
+=item C<void freeze(visit_info *info)>
+
+Archives the evaled code
+
+=item C<void thaw(visit_info *info)>
+
+Unarchives the code.
+
+=item C<void thawfinish(visit_info *info)>
+
+Final code fixup after thawing.
+
+=cut
+
+*/
+
+    void freeze(visit_info *info) {
+        IMAGE_IO *io = info->image_io;
+        STRING *packed = SELF.get_string();
+        io->vtable->push_string(INTERP, io, packed);
+        SUPER(info);
+    }
+
+    void thaw(visit_info *info) {
+        IMAGE_IO *io = info->image_io;
+        struct PackFile *pf;
+        STRING *packed;
+        size_t i;
+        struct PackFile_Segment *seg;
+        struct Parrot_sub * sub;
+
+        packed = io->vtable->shift_string(INTERP, io);
+        SUPER(info);
+        sub = PMC_sub(SELF);
+        pf = PackFile_new(INTERP, 0);
+        if (!PackFile_unpack(INTERP, pf, packed->strstart, packed->strlen))
+            real_exception(INTERP, NULL, E_IOError,
+                    "couldn't unpack packfile");
+        for (i = 0; i < pf->directory.num_segments; ++i) {
+            seg = pf->directory.segments[i];
+            if (seg->type == PF_BYTEC_SEG) {
+                PMC_sub(SELF)->seg = (struct PackFile_ByteCode *)seg;
+                break;
+            }
+        }
+        pf->directory.num_segments = 0;
+        PackFile_destroy(INTERP, pf);
+    }
+
+    void thawfinish(visit_info *info) {
+        struct Parrot_sub * sub = PMC_sub(SELF);
+        struct PackFile_ByteCode *seg = sub->seg;
+        /* XXX why - maybe somewhere interp->code is
+         * used instead of pf->cur_cs
+         */
+        sub->address = seg->base.data;
+        sub->end = sub->address + seg->base.size;
+    }
+
 }
 
 /*

Modified: branches/leo-ctx5/config/gen/makefiles/languages.in
==============================================================================
--- branches/leo-ctx5/config/gen/makefiles/languages.in (original)
+++ branches/leo-ctx5/config/gen/makefiles/languages.in Mon Jul 25 04:53:15 2005
@@ -1,9 +1,30 @@
 # $Id$
 
-PERL = ${perl}
+# setup of commands
 ${make_set_make}
-MAKE_C = ${make_c}
-LANGUAGES = BASIC befunge bf cola forth jako lisp m4 miniperl ook 
parrot_compiler perl6 regex scheme tcl urm
+PERL      = ${perl}
+MAKE_C    = ${make_c}
+
+# add new languages here
+# remove obsolete languages here
+LANGUAGES = \
+    BASIC \
+    befunge \
+    bf \
+    cola \
+    forth \
+    jako \
+    lisp \
+    m4 \
+    miniperl \
+    ook \
+    parrot_compiler \
+    perl6 \
+    punie \
+    regex \
+    scheme \
+    tcl \
+    urm
 
 # the default target
 all: $(LANGUAGES)
@@ -33,7 +54,24 @@ help:
 test:   all
        $(PERL) -I ../lib testall
 
-clean: BASIC.clean befunge.clean bf.clean cola.clean forth.clean jako.clean 
lisp.clean m4.clean miniperl.clean ook.clean parrot_compiler.clean perl6.clean 
regex.clean scheme.clean tcl.clean urm.clean
+clean: \
+    BASIC.clean \
+    befunge.clean \
+    bf.clean \
+    cola.clean \
+    forth.clean \
+    jako.clean \
+    lisp.clean \
+    m4.clean \
+    miniperl.clean \
+    ook.clean \
+    parrot_compiler.clean \
+    perl6.clean \
+    punie.clean \
+    regex.clean \
+    scheme.clean \
+    tcl.clean \
+    urm.clean
 
 
 #
@@ -52,25 +90,25 @@ BASIC.clean:
 
 befunge : befunge.dummy
 befunge.dummy:
-       $(MAKE_C) befunge
+       - $(MAKE_C) befunge
 befunge.test:
-       $(MAKE_C) befunge test
+       - $(MAKE_C) befunge test
 befunge.clean:
-       $(MAKE_C) befunge clean
+       - $(MAKE_C) befunge clean
 
 bf : bf.dummy
 bf.dummy:
-       $(MAKE_C) bf
+       - $(MAKE_C) bf
 bf.test:
-       $(MAKE_C) bf test
+       - $(MAKE_C) bf test
 bf.clean:
-       $(MAKE_C) bf clean
+       - $(MAKE_C) bf clean
 
 cola : cola.dummy
 cola.dummy:
-       $(MAKE_C) cola
+       - $(MAKE_C) cola
 cola.test:
-       $(MAKE_C) cola test
+       - $(MAKE_C) cola test
 cola.clean:
 # don't clean cola, as files in MANIFEST are removed
 
@@ -86,65 +124,73 @@ jako: jako.dummy
 jako.dummy:
 # don't make jako, as tests are executed by default
 jako.test:
-       $(MAKE_C) jako test
+       - $(MAKE_C) jako test
 jako.clean:
-       $(MAKE_C) jako clean
+       - $(MAKE_C) jako clean
 
 lisp: lisp.dummy
 lisp.dummy:
-       $(MAKE_C) lisp
+       - $(MAKE_C) lisp
 lisp.test:
-       $(MAKE_C) lisp test
+       - $(MAKE_C) lisp test
 lisp.clean:
-       $(MAKE_C) lisp clean
+       - $(MAKE_C) lisp clean
 
 m4: m4.dummy
 m4.dummy:
-       $(MAKE_C) m4
+       - $(MAKE_C) m4
 m4.test:
-       $(MAKE_C) m4 test
+       - $(MAKE_C) m4 test
 m4.clean:
-       $(MAKE_C) m4 clean
+       - $(MAKE_C) m4 clean
 
 miniperl : miniperl.dummy
 miniperl.dummy:
 # miniperl is missing t/harness
 # $(MAKE_C) miniperl
 miniperl.test:
-       $(MAKE_C) miniperl test
+       - $(MAKE_C) miniperl test
 miniperl.clean:
-       $(MAKE_C) miniperl clean
+       - $(MAKE_C) miniperl clean
 
 ook : ook.dummy
 ook.dummy:
-       $(MAKE_C) ook
+       - $(MAKE_C) ook
 ook.test:
-       $(MAKE_C) ook test
+       - $(MAKE_C) ook test
 ook.clean:
-       $(MAKE_C) ook clean
+       - $(MAKE_C) ook clean
 
 parrot_compiler: parrot_compiler.dummy
 parrot_compiler.dummy:
-       $(MAKE_C) parrot_compiler
+       - $(MAKE_C) parrot_compiler
 parrot_compiler.test:
 # no target test in parrot_compiler/Makefile
 # (MAKE_C) parrot_compiler test
 parrot_compiler.clean:
-       $(MAKE_C) parrot_compiler clean
+       - $(MAKE_C) parrot_compiler clean
 
 perl6 : perl6.dummy
 perl6.dummy:
-       $(MAKE_C) perl6
+       - $(MAKE_C) perl6
 perl6.test:
-       $(MAKE_C) perl6 test
+       - $(MAKE_C) perl6 test
 perl6.clean:
-       $(MAKE_C) perl6 clean
+       - $(MAKE_C) perl6 clean
+
+punie : punie.dummy
+punie.dummy:
+       - $(MAKE_C) punie
+punie.test:
+       - $(MAKE_C) punie test
+punie.clean:
+       - $(MAKE_C) punie clean
 
 regex: regex.dummy
 regex.dummy:
-       $(MAKE_C) regex
+       - $(MAKE_C) regex
 regex.test :
-       $(MAKE_C) regex test
+       - $(MAKE_C) regex test
 regex.clean :
 # No target clean for regex
 
@@ -152,22 +198,22 @@ scheme: scheme.dummy
 scheme.dummy:
        @echo "SKIPPED: scheme: (nothing to make, but should not default to 
make test)"
 scheme.test :
-       $(MAKE_C) scheme test
+       - $(MAKE_C) scheme test
 scheme.clean :
-       $(MAKE_C) scheme clean
+       - $(MAKE_C) scheme clean
 
 tcl: tcl.dummy
 tcl.dummy:
-       $(MAKE_C) tcl
+       - $(MAKE_C) tcl
 tcl.test:
-       $(MAKE_C) tcl test
+       - $(MAKE_C) tcl test
 tcl.clean:
-       $(MAKE_C) tcl clean
+       - $(MAKE_C) tcl clean
 
 urm: urm.dummy
 urm.dummy:
-       $(MAKE_C) urm
+       - $(MAKE_C) urm
 urm.test:
-       $(MAKE_C) urm test
+       - $(MAKE_C) urm test
 urm.clean:
-       $(MAKE_C) urm clean
+       - $(MAKE_C) urm clean

Modified: branches/leo-ctx5/config/gen/makefiles/tcl.in
==============================================================================
--- branches/leo-ctx5/config/gen/makefiles/tcl.in       (original)
+++ branches/leo-ctx5/config/gen/makefiles/tcl.in       Mon Jul 25 04:53:15 2005
@@ -18,61 +18,62 @@ PMCS = \
  tclparser
 
 DEPS = $(PARROT) \
-lib${slash}commands${slash}append.imc \
-lib${slash}commands${slash}array.imc \
-lib${slash}commands${slash}break.imc \
-lib${slash}commands${slash}catch.imc \
-lib${slash}commands${slash}concat.imc \
-lib${slash}commands${slash}continue.imc \
-lib${slash}commands${slash}error.imc \
-lib${slash}commands${slash}eval.imc \
-lib${slash}commands${slash}exit.imc \
-lib${slash}commands${slash}expr.imc \
-lib${slash}commands${slash}for.imc \
-lib${slash}commands${slash}foreach.imc \
-lib${slash}commands${slash}format.imc \
-lib${slash}commands${slash}global.imc \
-lib${slash}commands${slash}if.imc \
-lib${slash}commands${slash}incr.imc \
-lib${slash}commands${slash}info.imc \
-lib${slash}commands${slash}inline.imc \
-lib${slash}commands${slash}join.imc \
-lib${slash}commands${slash}lappend.imc \
+lib${slash}commands${slash}append.pir \
+lib${slash}commands${slash}array.pir \
+lib${slash}commands${slash}break.pir \
+lib${slash}commands${slash}catch.pir \
+lib${slash}commands${slash}concat.pir \
+lib${slash}commands${slash}continue.pir \
+lib${slash}commands${slash}error.pir \
+lib${slash}commands${slash}eval.pir \
+lib${slash}commands${slash}exit.pir \
+lib${slash}commands${slash}expr.pir \
+lib${slash}commands${slash}for.pir \
+lib${slash}commands${slash}foreach.pir \
+lib${slash}commands${slash}format.pir \
+lib${slash}commands${slash}global.pir \
+lib${slash}commands${slash}if.pir \
+lib${slash}commands${slash}incr.pir \
+lib${slash}commands${slash}info.pir \
+lib${slash}commands${slash}inline.pir \
+lib${slash}commands${slash}join.pir \
+lib${slash}commands${slash}lappend.pir \
 lib${slash}commands${slash}lindex.pir \
-lib${slash}commands${slash}linsert.imc \
-lib${slash}commands${slash}list.imc \
-lib${slash}commands${slash}llength.imc \
-lib${slash}commands${slash}lrange.imc \
-lib${slash}commands${slash}lrepeat.imc \
-lib${slash}commands${slash}namespace.imc \
-lib${slash}commands${slash}open.imc \
-lib${slash}commands${slash}proc.imc \
-lib${slash}commands${slash}puts.imc \
-lib${slash}commands${slash}rename.imc \
-lib${slash}commands${slash}return.imc \
-lib${slash}commands${slash}set.imc \
-lib${slash}commands${slash}source.imc \
-lib${slash}commands${slash}string.imc \
-lib${slash}commands${slash}time.imc \
-lib${slash}commands${slash}unknown.imc \
-lib${slash}commands${slash}unset.imc \
-lib${slash}commands${slash}uplevel.imc \
-lib${slash}commands${slash}upvar.imc \
-lib${slash}commands${slash}while.imc \
+lib${slash}commands${slash}linsert.pir \
+lib${slash}commands${slash}list.pir \
+lib${slash}commands${slash}llength.pir \
+lib${slash}commands${slash}lrange.pir \
+lib${slash}commands${slash}lrepeat.pir \
+lib${slash}commands${slash}namespace.pir \
+lib${slash}commands${slash}open.pir \
+lib${slash}commands${slash}package.pir \
+lib${slash}commands${slash}proc.pir \
+lib${slash}commands${slash}puts.pir \
+lib${slash}commands${slash}rename.pir \
+lib${slash}commands${slash}return.pir \
+lib${slash}commands${slash}set.pir \
+lib${slash}commands${slash}source.pir \
+lib${slash}commands${slash}string.pir \
+lib${slash}commands${slash}time.pir \
+lib${slash}commands${slash}unknown.pir \
+lib${slash}commands${slash}unset.pir \
+lib${slash}commands${slash}uplevel.pir \
+lib${slash}commands${slash}upvar.pir \
+lib${slash}commands${slash}while.pir \
 lib${slash}conversions.pir \
-lib${slash}expression.imc \
-lib${slash}get_var.imc \
-lib${slash}interpret.imc \
-lib${slash}list.imc \
-lib${slash}macros${slash}is_space.imc \
-lib${slash}string_to_list.imc \
+lib${slash}expression.pir \
+lib${slash}get_var.pir \
+lib${slash}interpret.pir \
+lib${slash}list.pir \
+lib${slash}macros${slash}is_space.pir \
+lib${slash}string_to_list.pir \
 lib${slash}tcl.p6r \
 lib${slash}variables.pir \
-tcl.imc_template \
+tcl.pir_template \
 tcl.pl
 
-tcl.pbc: pmcs lib${slash}tcllib.pbc lib${slash}tclword.pbc tcl.imc
-       $(PARROT) --output=tcl.pbc tcl.imc
+tcl.pbc: pmcs lib${slash}tcllib.pbc lib${slash}tclword.pbc tcl.pir
+       $(PARROT) --output=tcl.pbc tcl.pir
 
 pmcs:
        @cd $(CLASSDIR) && $(BUILD) generate $(PMCS)
@@ -80,14 +81,14 @@ pmcs:
        @cd $(CLASSDIR) && $(BUILD) linklibs $(PMCS)
        @cd $(CLASSDIR) && $(BUILD) copy "--destination=$(DESTDIR)" $(PMCS)
 
-lib${slash}tcllib.imc: $(DEPS)
-       $(PERL) tcl.pl > lib${slash}tcllib.imc
+lib${slash}tcllib.pir: $(DEPS)
+       $(PERL) tcl.pl > lib${slash}tcllib.pir
 
-lib${slash}tcllib.pbc: lib${slash}tcllib.imc
-       $(PARROT) --output=$(LIBPATH)${slash}tcllib.pbc 
$(LIBPATH)${slash}tcllib.imc
+lib${slash}tcllib.pbc: lib${slash}tcllib.pir
+       $(PARROT) --output=$(LIBPATH)${slash}tcllib.pbc 
$(LIBPATH)${slash}tcllib.pir
 
-lib${slash}tclword.pbc: lib${slash}tclword.imc
-       $(PARROT) --output=$(LIBPATH)${slash}tclword.pbc 
$(LIBPATH)${slash}tclword.imc
+lib${slash}tclword.pbc: lib${slash}tclword.pir
+       $(PARROT) --output=$(LIBPATH)${slash}tclword.pbc 
$(LIBPATH)${slash}tclword.pir
 
 tclsh: tcl.pbc
        $(PARROT) --gc-debug tcl.pbc
@@ -105,7 +106,7 @@ devtest:
        cd t && $(PERL) -e 'use Test::Harness qw($$verbose runtests) ; 
$$Test::Harness::verbose=1;runtests(glob("*.t"))' && cd ..
 
 clean:
-       $(RM_F) lib${slash}tcllib.imc tcl.pbc lib${slash}*.pbc 
$(CLASSDIR)${slash}pmc_*.h $(CLASSDIR)${slash}*_group.h 
$(CLASSDIR)${slash}*$(LOAD_EXT) $(CLASSDIR)${slash}*.dump 
$(CLASSDIR)${slash}*.c $(CLASSDIR)${slash}*$(O)
+       $(RM_F) lib${slash}tcllib.pir tcl.pbc lib${slash}*.pbc 
$(CLASSDIR)${slash}pmc_*.h $(CLASSDIR)${slash}*_group.h 
$(CLASSDIR)${slash}*$(LOAD_EXT) $(CLASSDIR)${slash}*.dump 
$(CLASSDIR)${slash}*.c $(CLASSDIR)${slash}*$(O)
 
 distclean: clean
        $(RM_F) Makefile

Modified: branches/leo-ctx5/config/gen/platform/win32/exec.c
==============================================================================
--- branches/leo-ctx5/config/gen/platform/win32/exec.c  (original)
+++ branches/leo-ctx5/config/gen/platform/win32/exec.c  Mon Jul 25 04:53:15 2005
@@ -63,22 +63,21 @@ Parrot_Run_OS_Command_Argv(Parrot_Interp
     if (pmclen == 0) {
         internal_exception(NOSPAWN, "Empty argument array for spawnw");
     }
-    
+
     /* Now build command line. */
     for (i = 0; i < pmclen; i++) {
-          STRING *s = VTABLE_get_string_keyed_int(interpreter, cmdargs, i);
-           char *cs = string_to_cstring(interpreter, s);
-          if (cmdlinepos + s->strlen + 3 > cmdlinelen)
-           {
-              cmdlinelen += s->strlen + 4;
-               mem_sys_realloc(cmdline, cmdlinelen);
+        STRING *s = VTABLE_get_string_keyed_int(interpreter, cmdargs, i);
+        char *cs = string_to_cstring(interpreter, s);
+        if (cmdlinepos + s->strlen + 3 > cmdlinelen) {
+            cmdlinelen += s->strlen + 4;
+            cmdline = mem_sys_realloc(cmdline, cmdlinelen);
         }
         strcpy(cmdline + cmdlinepos, "\"");
         strcpy(cmdline + cmdlinepos + 1, cs);
         strcpy(cmdline + cmdlinepos + 1 + s->strlen, "\" ");
         cmdlinepos += s->strlen + 3;
     }
-    
+
     /* Start the child process. */
     memset(&si, 0, sizeof(si));
     si.cb = sizeof(si);

Modified: branches/leo-ctx5/docs/ROADMAP
==============================================================================
--- branches/leo-ctx5/docs/ROADMAP      (original)
+++ branches/leo-ctx5/docs/ROADMAP      Mon Jul 25 04:53:15 2005
@@ -427,7 +427,7 @@ Portable fcntl() replacement for platfor
 
 =item *
 
-See PORTABILITY. Test suite should have no failure on supported platforms.
+See L<PORTABILITY>. Test suite should have no failure on supported platforms.
 
 =item *
 

Modified: branches/leo-ctx5/docs/compiler_faq.pod
==============================================================================
--- branches/leo-ctx5/docs/compiler_faq.pod     (original)
+++ branches/leo-ctx5/docs/compiler_faq.pod     Mon Jul 25 04:53:15 2005
@@ -20,6 +20,12 @@ Parrot.
 =head2 How can I implement a compiler to use as a compiler object from within
 Parrot? (For example, with the C<compile> op.)
 
+Define a sub that takes as input a string, and returns something invokable.
+The easiest way to create something invokable at the moment is to use the 
builtin
+C<PIR> or C<PASM> compilers.
+
+See C<languages/tcl/tcl.pir_template>'s C<.sub _tcl_compile> as an example.
+
 =head2 How do I embed source locations in my code for debugging?
 
 You can do this using the C<setfile> and C<setline> opcodes. Simply

Modified: branches/leo-ctx5/include/parrot/debug.h
==============================================================================
--- branches/leo-ctx5/include/parrot/debug.h    (original)
+++ branches/leo-ctx5/include/parrot/debug.h    Mon Jul 25 04:53:15 2005
@@ -282,6 +282,12 @@ void PDB_help(Interp *interpreter, const
 
 void PDB_backtrace(Interp *interpreter);
 
+/*
+ * These constants correspond to the debugger commands and are
+ * used in src/debug.c. To map command strings to their
+ * numeric values, use the algorithm from parse_command() in that file.
+ */
+
 #define c_b             25245
 #define c_c             25500
 #define c_d             25755

Modified: branches/leo-ctx5/languages/BASIC/interpreter/expr.pasm
==============================================================================
--- branches/leo-ctx5/languages/BASIC/interpreter/expr.pasm     (original)
+++ branches/leo-ctx5/languages/BASIC/interpreter/expr.pasm     Mon Jul 25 
04:53:15 2005
@@ -417,7 +417,7 @@ FUNC_ASC:
        # Re-used a few places.  :)
        # Boy, is this handy.
 SET_S1_ASCII:
-       set S1, 
"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+       set S1, 
binary:"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
        ret
 
 # Errors for the functions.

Modified: branches/leo-ctx5/languages/LANGUAGES.STATUS
==============================================================================
--- branches/leo-ctx5/languages/LANGUAGES.STATUS        (original)
+++ branches/leo-ctx5/languages/LANGUAGES.STATUS        Mon Jul 25 04:53:15 2005
@@ -137,6 +137,13 @@ A: Alan Knowles
 D: An experimental implementation of PHP
 W: http://devel.akbkhome.com/svn/index.php/PintCompiler/
 
+N: Punie
+A: Allison Randal
+D: An implementation of Perl1, implemented in PIR with PGE
+S: 'print 1' is working
+M: Yes
+V: 0.2.2
+
 N: Python
 A: Michal J Wallace
 S: Mostly working except for classes/exec/import. For licensing

Modified: branches/leo-ctx5/languages/testall
==============================================================================
--- branches/leo-ctx5/languages/testall (original)
+++ branches/leo-ctx5/languages/testall Mon Jul 25 04:53:15 2005
@@ -16,11 +16,17 @@ There are 3 ways to run a language test:
 
 =item * Overall Harness
 
-C<cd languages && make test>
+C<make languages-test> 
+
+or
+
+C<cd languages && make test> or
 
 =item * Per Language Harness
 
-e.g., C<cd languages/tcl && make test>
+For well behaved languages you can do something like:
+
+C<cd languages/tcl && make test>
 
 =item * Run a single test for more detailed output.
 
@@ -68,6 +74,7 @@ my @unified_testable_languages = 
        m4
        ook
        parrot_compiler
+       punie
        scheme
        tcl
        urm );
@@ -86,7 +93,7 @@ foreach my $harness (@harnesses) {
     push @testfiles, <FILES>;
     close(FILES);
 }
-chomp( @testfiles );
+chomp(@testfiles);
 
 # Step 3: test.
 

Modified: branches/leo-ctx5/src/packfile.c
==============================================================================
--- branches/leo-ctx5/src/packfile.c    (original)
+++ branches/leo-ctx5/src/packfile.c    Mon Jul 25 04:53:15 2005
@@ -805,8 +805,6 @@ PackFile_remove_segment_by_name (Interp*
                        (dir->num_segments - i) *
                        sizeof (struct PackFile_Segment *));
             }
-            dir->segments = mem_sys_realloc (dir->segments,
-                       sizeof (struct PackFile_Segment *) * dir->num_segments);
             return seg;
         }
     }

Modified: branches/leo-ctx5/src/pmc_freeze.c
==============================================================================
--- branches/leo-ctx5/src/pmc_freeze.c  (original)
+++ branches/leo-ctx5/src/pmc_freeze.c  Mon Jul 25 04:53:15 2005
@@ -675,7 +675,6 @@ static image_funcs opcode_funcs = {
     shift_opcode_number
 };
 #endif
-static IMAGE_IO io_init;
 
 /*
 
@@ -694,7 +693,7 @@ ft_init(Parrot_Interp interpreter, visit
     STRING *s = info->image;
     struct PackFile *pf;
 
-    info->image_io = &io_init;
+    info->image_io = mem_sys_allocate(sizeof(IMAGE_IO));
     info->image_io->image = s = info->image;
 #if FREEZE_ASCII
     info->image_io->vtable = &ascii_funcs;
@@ -1500,6 +1499,7 @@ run_thaw(Parrot_Interp interpreter, STRI
         Parrot_unblock_DOD(interpreter);
         Parrot_unblock_GC(interpreter);
     }
+    mem_sys_free(info.image_io);
     return info.thaw_result;
 }
 
@@ -1540,6 +1540,7 @@ Parrot_freeze_at_destruct(Parrot_Interp 
     visit_loop_next_for_GC(interpreter, pmc, &info);
 
     Parrot_unblock_DOD(interpreter);
+    mem_sys_free(info.image_io);
     return info.image;
 }
 
@@ -1576,6 +1577,7 @@ Parrot_freeze(Parrot_Interp interpreter,
 
     visit_loop_todo_list(interpreter, pmc, &info);
 
+    mem_sys_free(info.image_io);
     return info.image;
 #endif
 }

Modified: branches/leo-ctx5/t/op/spawnw.t
==============================================================================
--- branches/leo-ctx5/t/op/spawnw.t     (original)
+++ branches/leo-ctx5/t/op/spawnw.t     Mon Jul 25 04:53:15 2005
@@ -34,7 +34,7 @@ Nigel Sandever - L<[EMAIL PROTECTED]
 
 =cut
 
-use Parrot::Test tests => 6;
+use Parrot::Test tests => 7;
 
 # perl command coded this way to avoid platform 
 # quoting issue.
@@ -132,3 +132,31 @@ output_is(<<'CODE', <<'OUTPUT', "exit co
 CODE
 return code: 3
 OUTPUT
+
+pir_output_is(<<'CODE', <<'OUTPUT', "grow argv buffer");
+.sub test @MAIN
+        .local pmc args
+
+        $S0 = "exit length(qq{"
+        $I0 = 0
+loop:
+        if $I0 >= 1000 goto end
+        $S0 = concat $S0, "A"
+        inc $I0
+        branch loop
+end:
+        $S0 = concat $S0, "}) / 100"
+        new args, .PerlArray
+        push args, "perl"
+        push args, "-e"
+        push args, $S0
+        $I0 = spawnw args
+        shr $I1, $I0, 8
+        print   "return code: "
+        print   $I1
+        print   "\n"
+        end
+.end
+CODE
+return code: 10
+OUTPUT

Modified: branches/leo-ctx5/t/pmc/eval.t
==============================================================================
--- branches/leo-ctx5/t/pmc/eval.t      (original)
+++ branches/leo-ctx5/t/pmc/eval.t      Mon Jul 25 04:53:15 2005
@@ -17,7 +17,7 @@ Tests on-the-fly PASM, PIR and PAST comp
 
 =cut
 
-use Parrot::Test tests => 12;
+use Parrot::Test tests => 14;
 use Test::More;
 
 output_is(<<'CODE', <<'OUTPUT', "eval_sc");
@@ -407,5 +407,59 @@ hello from foo_2
 OUTPUT
 
 END {
-       unlink "temp.pnc";
+       unlink "temp.pnc", "temp.file";
 };
+
+pir_output_is(<<'CODE', <<'OUTPUT', "eval.freeze");
+.sub main @MAIN
+  .local pmc f, e
+  .local pmc io
+  f = compi("foo_1", "hello from foo_1")
+  $S0 = freeze f
+  io = open "temp.file", ">"
+  print io, $S0
+  close io
+  print "written\n"
+.end
+
+.sub compi
+  .param string name
+  .param string printme
+  .local string code
+  .local pmc pir_compiler, retval
+  pir_compiler = compreg "PIR"
+  code = ".sub "
+  code .= name
+  code .= "\n"
+  code .= "print \""
+  code .= printme
+  code .= "\\n\"\n"
+  code .= ".end\n"
+
+  retval = compile pir_compiler, code
+  .return (retval)
+.end
+CODE
+written
+OUTPUT
+
+pir_output_is(<<'CODE', <<'OUTPUT', "eval.thaw");
+.sub main @MAIN
+    .local pmc io, e
+    .local string file
+    .local int size
+    file = "temp.file"
+    .include "stat.pasm"
+    size = stat file, .STAT_FILESIZE
+    io = open file, "<"
+    $S0 = read io, size
+    close io
+    e = thaw $S0
+    e()
+    e = find_global "foo_1"
+    e()
+.end
+CODE
+hello from foo_1
+hello from foo_1
+OUTPUT

Reply via email to