[svn:parrot] r36517 - in branches/vtable_morph_change: . config/auto config/auto/format config/gen config/gen/makefiles config/init/hints docs docs/book docs/dev docs/imcc docs/pct docs/pdds docs/pdds/draft docs/project docs/user/pir editor examples/benchmarks examples/nci examples/pir ext/Parrot-Embed/lib/Parrot include/parrot languages languages/PIR languages/befunge languages/ecmascript/t/sanity_pt languages/lua/config/makefiles languages/lua/doc languages/lua/src/pmc languages/lua/t/test languages/perl6 languages/perl6/build languages/perl6/config languages/perl6/docs languages/perl6/src languages/perl6/t languages/perl6/tools languages/pipp languages/pipp/docs languages/pipp/src/classes languages/pipp/src/common languages/pipp/src/pct languages/pipp/src/pmc languages/pipp/t/embed languages/pipp/t/php languages/pynie/src/builtins languages/pynie/src/parser languages/squaak/doc lib/Parrot lib/Parrot/Configure lib/Parrot/Docs/Section lib/Parrot/Pmc2c ports/cygwin p orts/debian ports/macports runtime/parrot/library runtime/parrot/library/Parrot src src/dynpmc src/gc src/jit/i386 src/ops src/pmc src/string src/string/charset t/codingstd t/compilers/tge t/dynpmc t/native_pbc t/oo t/perl t/pmc t/steps tools/dev tools/install tools/util

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Tue Feb 10 02:09:45 UTC 2009


Author: whiteknight
Date: Tue Feb 10 02:09:33 2009
New Revision: 36517
URL: https://trac.parrot.org/parrot/changeset/36517

Log:
[vtable_morph_change] update branch to trunk r36514. Stymied by the weird IO buffering bug and my build fails. Waiting for this issue to be resolved before my work in this branch can continue

Added:
   branches/vtable_morph_change/docs/book/appX_patch_submission.pod
      - copied unchanged from r36514, trunk/docs/book/appX_patch_submission.pod
   branches/vtable_morph_change/src/dynpmc/pair.pmc
      - copied unchanged from r36514, trunk/src/dynpmc/pair.pmc
   branches/vtable_morph_change/src/pbc_dump.c
      - copied unchanged from r36514, trunk/src/pbc_dump.c
   branches/vtable_morph_change/src/pmc/bignum.pmc
      - copied unchanged from r36514, trunk/src/pmc/bignum.pmc
   branches/vtable_morph_change/t/dynpmc/pair.t
      - copied unchanged from r36514, trunk/t/dynpmc/pair.t
   branches/vtable_morph_change/tools/dev/pbc_to_exe.pir
      - copied unchanged from r36514, trunk/tools/dev/pbc_to_exe.pir
Deleted:
   branches/vtable_morph_change/docs/book/appendix.pod
   branches/vtable_morph_change/docs/pdds/README
   branches/vtable_morph_change/languages/perl6/Configure.pl
   branches/vtable_morph_change/languages/perl6/MAINTAINER
   branches/vtable_morph_change/languages/perl6/ROADMAP
   branches/vtable_morph_change/languages/perl6/Test.pm
   branches/vtable_morph_change/languages/perl6/build/
   branches/vtable_morph_change/languages/perl6/config/
   branches/vtable_morph_change/languages/perl6/docs/
   branches/vtable_morph_change/languages/perl6/perl6.pir
   branches/vtable_morph_change/languages/perl6/src/
   branches/vtable_morph_change/languages/perl6/t/
   branches/vtable_morph_change/languages/perl6/tools/
   branches/vtable_morph_change/src/bignum.c
   branches/vtable_morph_change/src/bignum.h
   branches/vtable_morph_change/src/pdump.c
   branches/vtable_morph_change/t/pmc/bignum.t
   branches/vtable_morph_change/tools/dev/pbc_to_exe_gen.pl
Modified:
   branches/vtable_morph_change/   (props changed)
   branches/vtable_morph_change/Configure.pl
   branches/vtable_morph_change/MANIFEST
   branches/vtable_morph_change/MANIFEST.SKIP
   branches/vtable_morph_change/MANIFEST.generated
   branches/vtable_morph_change/META.yml
   branches/vtable_morph_change/README
   branches/vtable_morph_change/README_win32.pod
   branches/vtable_morph_change/config/auto/format.pm
   branches/vtable_morph_change/config/auto/format/intval_maxmin_c.in   (props changed)
   branches/vtable_morph_change/config/gen/languages.pm
   branches/vtable_morph_change/config/gen/makefiles/dynoplibs_pl.in
   branches/vtable_morph_change/config/gen/makefiles/dynpmc.in
   branches/vtable_morph_change/config/gen/makefiles/dynpmc_pl.in
   branches/vtable_morph_change/config/gen/makefiles/languages.in
   branches/vtable_morph_change/config/gen/makefiles/root.in
   branches/vtable_morph_change/config/init/hints/mswin32.pm
   branches/vtable_morph_change/docs/book/README
   branches/vtable_morph_change/docs/book/ch01_overview.pod
   branches/vtable_morph_change/docs/book/ch02_getting_started.pod
   branches/vtable_morph_change/docs/book/ch03_pir_basics.pod
   branches/vtable_morph_change/docs/book/ch04_pir_subroutines.pod
   branches/vtable_morph_change/docs/book/ch05_pasm.pod
   branches/vtable_morph_change/docs/book/ch06_library.pod
   branches/vtable_morph_change/docs/book/ch07_testing_and_debugging.pod   (contents, props changed)
   branches/vtable_morph_change/docs/book/ch08_architecture.pod   (contents, props changed)
   branches/vtable_morph_change/docs/book/ch09_pct.pod   (contents, props changed)
   branches/vtable_morph_change/docs/book/ch10_hlls.pod   (contents, props changed)
   branches/vtable_morph_change/docs/book/ch11_pmcs.pod   (contents, props changed)
   branches/vtable_morph_change/docs/book/ch12_opcodes.pod   (contents, props changed)
   branches/vtable_morph_change/docs/book/ch13_reference.pod   (contents, props changed)
   branches/vtable_morph_change/docs/debug.pod
   branches/vtable_morph_change/docs/dev/c_functions.pod   (props changed)
   branches/vtable_morph_change/docs/dev/fhs.pod
   branches/vtable_morph_change/docs/embed.pod
   branches/vtable_morph_change/docs/glossary.pod
   branches/vtable_morph_change/docs/imcc/README
   branches/vtable_morph_change/docs/intro.pod
   branches/vtable_morph_change/docs/overview.pod
   branches/vtable_morph_change/docs/parrot.pod
   branches/vtable_morph_change/docs/parrotbyte.pod
   branches/vtable_morph_change/docs/pct/gettingstarted.pod
   branches/vtable_morph_change/docs/pdds/draft/pdd30_install.pod
   branches/vtable_morph_change/docs/pdds/pdd00_pdd.pod
   branches/vtable_morph_change/docs/pdds/pdd03_calling_conventions.pod
   branches/vtable_morph_change/docs/pdds/pdd07_codingstd.pod
   branches/vtable_morph_change/docs/pdds/pdd09_gc.pod
   branches/vtable_morph_change/docs/pdds/pdd13_bytecode.pod
   branches/vtable_morph_change/docs/pdds/pdd15_objects.pod
   branches/vtable_morph_change/docs/pdds/pdd17_pmc.pod
   branches/vtable_morph_change/docs/pdds/pdd18_security.pod
   branches/vtable_morph_change/docs/pdds/pdd19_pir.pod
   branches/vtable_morph_change/docs/pdds/pdd20_lexical_vars.pod
   branches/vtable_morph_change/docs/pdds/pdd21_namespaces.pod
   branches/vtable_morph_change/docs/pdds/pdd22_io.pod
   branches/vtable_morph_change/docs/pdds/pdd23_exceptions.pod
   branches/vtable_morph_change/docs/pdds/pdd24_events.pod
   branches/vtable_morph_change/docs/pdds/pdd25_concurrency.pod
   branches/vtable_morph_change/docs/pdds/pdd26_ast.pod
   branches/vtable_morph_change/docs/pdds/pdd27_multiple_dispatch.pod
   branches/vtable_morph_change/docs/pdds/pdd28_strings.pod
   branches/vtable_morph_change/docs/pdds/pdd_template.pod
   branches/vtable_morph_change/docs/project/metacommitter_guide.pod
   branches/vtable_morph_change/docs/project/ubuntu_packaging_guide.pod   (contents, props changed)
   branches/vtable_morph_change/docs/running.pod
   branches/vtable_morph_change/docs/submissions.pod
   branches/vtable_morph_change/docs/tests.pod
   branches/vtable_morph_change/docs/user/pir/pp001-intro.pod
   branches/vtable_morph_change/docs/user/pir/pp002-pmc.pod
   branches/vtable_morph_change/docs/vtables.pod
   branches/vtable_morph_change/editor/pir-mode.el
   branches/vtable_morph_change/examples/benchmarks/array_access.pir
   branches/vtable_morph_change/examples/nci/Mysql.pir
   branches/vtable_morph_change/examples/pir/pirric.pir
   branches/vtable_morph_change/ext/Parrot-Embed/lib/Parrot/Embed.xs
   branches/vtable_morph_change/include/parrot/datatypes.h
   branches/vtable_morph_change/include/parrot/encoding.h
   branches/vtable_morph_change/include/parrot/gc_api.h   (props changed)
   branches/vtable_morph_change/include/parrot/gc_mark_sweep.h   (props changed)
   branches/vtable_morph_change/include/parrot/gc_pools.h   (props changed)
   branches/vtable_morph_change/include/parrot/interpreter.h
   branches/vtable_morph_change/include/parrot/parrot.h
   branches/vtable_morph_change/include/parrot/string_funcs.h
   branches/vtable_morph_change/include/parrot/sub.h
   branches/vtable_morph_change/languages/   (props changed)
   branches/vtable_morph_change/languages/PIR/pir.pir   (props changed)
   branches/vtable_morph_change/languages/befunge/Configure.pl   (props changed)
   branches/vtable_morph_change/languages/ecmascript/t/sanity_pt/03-boolean.t   (props changed)
   branches/vtable_morph_change/languages/lua/config/makefiles/root.in
   branches/vtable_morph_change/languages/lua/doc/lua51.bnf
   branches/vtable_morph_change/languages/lua/doc/running.pod
   branches/vtable_morph_change/languages/lua/doc/status.pod
   branches/vtable_morph_change/languages/lua/src/pmc/lua.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/lua_private.h
   branches/vtable_morph_change/languages/lua/src/pmc/luaany.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luaboolean.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luabytecode.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luafunction.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luanil.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luanumber.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luastring.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luatable.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luathread.pmc
   branches/vtable_morph_change/languages/lua/src/pmc/luauserdata.pmc
   branches/vtable_morph_change/languages/lua/t/test/bisect-output-win32.txt   (props changed)
   branches/vtable_morph_change/languages/perl6/README
   branches/vtable_morph_change/languages/pipp/docs/internals.pod   (props changed)
   branches/vtable_morph_change/languages/pipp/pipp.pir   (props changed)
   branches/vtable_morph_change/languages/pipp/src/classes/Object.pir   (props changed)
   branches/vtable_morph_change/languages/pipp/src/common/php_filesystem.pir   (props changed)
   branches/vtable_morph_change/languages/pipp/src/pct/actions.pm
   branches/vtable_morph_change/languages/pipp/src/pct/grammar.pg
   branches/vtable_morph_change/languages/pipp/src/pmc/pipp_hash.c   (props changed)
   branches/vtable_morph_change/languages/pipp/src/pmc/pipp_hash.h   (props changed)
   branches/vtable_morph_change/languages/pipp/t/embed/eval.t   (props changed)
   branches/vtable_morph_change/languages/pipp/t/php/control_flow.t
   branches/vtable_morph_change/languages/pipp/t/php/filesystem.t   (props changed)
   branches/vtable_morph_change/languages/pynie/src/builtins/io.pir
   branches/vtable_morph_change/languages/pynie/src/builtins/lists.pir
   branches/vtable_morph_change/languages/pynie/src/builtins/oper.pir
   branches/vtable_morph_change/languages/pynie/src/parser/indent.pir
   branches/vtable_morph_change/languages/squaak/doc/tutorial_episode_1.pod
   branches/vtable_morph_change/lib/Parrot/Configure/Compiler.pm
   branches/vtable_morph_change/lib/Parrot/Docs/Section/Languages.pm
   branches/vtable_morph_change/lib/Parrot/Pmc2c/Attribute.pm
   branches/vtable_morph_change/lib/Parrot/Pmc2c/Pmc2cMain.pm
   branches/vtable_morph_change/lib/Parrot/Test.pm
   branches/vtable_morph_change/parrot.spec
   branches/vtable_morph_change/parrotbug
   branches/vtable_morph_change/ports/cygwin/README
   branches/vtable_morph_change/ports/debian/changelog
   branches/vtable_morph_change/ports/debian/control.in
   branches/vtable_morph_change/ports/debian/parrot.install
   branches/vtable_morph_change/ports/debian/rules
   branches/vtable_morph_change/ports/macports/Portfile
   branches/vtable_morph_change/runtime/parrot/library/P6object.pir
   branches/vtable_morph_change/runtime/parrot/library/Parrot/Coroutine.pir
   branches/vtable_morph_change/src/debug.c
   branches/vtable_morph_change/src/dynext.c
   branches/vtable_morph_change/src/exceptions.c
   branches/vtable_morph_change/src/exec_save.c
   branches/vtable_morph_change/src/gc/api.c   (props changed)
   branches/vtable_morph_change/src/gc/generational_ms.c   (props changed)
   branches/vtable_morph_change/src/gc/incremental_ms.c   (props changed)
   branches/vtable_morph_change/src/gc/mark_sweep.c   (contents, props changed)
   branches/vtable_morph_change/src/gc/pools.c   (props changed)
   branches/vtable_morph_change/src/gc/system.c   (props changed)
   branches/vtable_morph_change/src/jit/i386/exec_dep.h
   branches/vtable_morph_change/src/library.c
   branches/vtable_morph_change/src/oo.c
   branches/vtable_morph_change/src/ops/core.ops
   branches/vtable_morph_change/src/ops/string.ops
   branches/vtable_morph_change/src/packdump.c
   branches/vtable_morph_change/src/packfile.c
   branches/vtable_morph_change/src/parrot_debugger.c
   branches/vtable_morph_change/src/pmc.c
   branches/vtable_morph_change/src/pmc/bigint.pmc
   branches/vtable_morph_change/src/pmc/class.pmc
   branches/vtable_morph_change/src/pmc/coroutine.pmc
   branches/vtable_morph_change/src/pmc/exceptionhandler.pmc
   branches/vtable_morph_change/src/pmc/multisub.pmc
   branches/vtable_morph_change/src/pmc/namespace.pmc
   branches/vtable_morph_change/src/pmc/object.pmc
   branches/vtable_morph_change/src/pmc/pmc.num
   branches/vtable_morph_change/src/pmc/string.pmc
   branches/vtable_morph_change/src/pmc/stringhandle.pmc
   branches/vtable_morph_change/src/pmc/sub.pmc
   branches/vtable_morph_change/src/pmc/undef.pmc
   branches/vtable_morph_change/src/runops_cores.c
   branches/vtable_morph_change/src/scheduler.c
   branches/vtable_morph_change/src/string/api.c
   branches/vtable_morph_change/src/string/charset.c
   branches/vtable_morph_change/src/string/charset/iso-8859-1.c
   branches/vtable_morph_change/src/string/encoding.c
   branches/vtable_morph_change/src/sub.c
   branches/vtable_morph_change/src/trace.c
   branches/vtable_morph_change/src/warnings.c
   branches/vtable_morph_change/t/codingstd/copyright.t
   branches/vtable_morph_change/t/codingstd/pdd_format.t
   branches/vtable_morph_change/t/codingstd/perlcritic.t
   branches/vtable_morph_change/t/compilers/tge/NoneGrammar.tg   (props changed)
   branches/vtable_morph_change/t/native_pbc/integer.t
   branches/vtable_morph_change/t/native_pbc/number.t
   branches/vtable_morph_change/t/oo/attributes.t   (contents, props changed)
   branches/vtable_morph_change/t/oo/inheritance.t   (contents, props changed)
   branches/vtable_morph_change/t/perl/Parrot_Distribution.t
   branches/vtable_morph_change/t/pmc/exceptionhandler.t
   branches/vtable_morph_change/t/steps/auto_format-01.t
   branches/vtable_morph_change/t/steps/gen_makefiles-01.t
   branches/vtable_morph_change/tools/dev/mk_gitignore.pl   (props changed)
   branches/vtable_morph_change/tools/dev/mk_native_pbc
   branches/vtable_morph_change/tools/dev/pbc_header.pl
   branches/vtable_morph_change/tools/install/smoke.pl
   branches/vtable_morph_change/tools/util/perlcritic-cage.conf   (props changed)
   branches/vtable_morph_change/tools/util/pgegrep

Modified: branches/vtable_morph_change/Configure.pl
==============================================================================
--- branches/vtable_morph_change/Configure.pl	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/Configure.pl	Tue Feb 10 02:09:33 2009	(r36517)
@@ -63,6 +63,9 @@
 
 # from Parrot::Configure::Data
 $conf->options->set( %{$args} );
+# save the command-line for make reconfig
+$conf->data->set(configure_args => @ARGV ? '"'.join("\" \"", map {qq($_)} @ARGV).'"'
+                                         : '');
 
 # Log files created by Configure.pl in MANIFEST.configure.generated
 $conf->{active_configuration} = 1;

Modified: branches/vtable_morph_change/MANIFEST
==============================================================================
--- branches/vtable_morph_change/MANIFEST	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/MANIFEST	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Feb  1 22:48:40 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Mon Feb  9 06:46:28 2009 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -416,7 +416,7 @@
 config/inter/types.pm                                       []
 config/inter/yacc.pm                                        []
 docs/book/README                                            [main]doc
-docs/book/appendix.pod                                      [main]doc
+docs/book/appX_patch_submission.pod                         [main]doc
 docs/book/ch01_overview.pod                                 [main]doc
 docs/book/ch02_getting_started.pod                          [main]doc
 docs/book/ch03_pir_basics.pod                               [main]doc
@@ -471,7 +471,6 @@
 docs/pct/gettingstarted.pod                                 [main]doc
 docs/pct/past_building_blocks.pod                           [main]doc
 docs/pct/pct_optable_guide.pod                              [main]doc
-docs/pdds/README                                            [main]doc
 docs/pdds/draft/pdd01_overview.pod                          [main]doc
 docs/pdds/draft/pdd05_opfunc.pod                            [main]doc
 docs/pdds/draft/pdd06_pasm.pod                              [main]doc
@@ -521,6 +520,7 @@
 docs/project/roles_responsibilities.pod                     [main]doc
 docs/project/support_policy.pod                             [main]doc
 docs/project/ticket_wrangler_guide.pod                      [main]doc
+docs/project/ubuntu_packaging_guide.pod                     [main]doc
 docs/req/model_users.pod                                    [main]doc
 docs/resources/favicon.ico                                  [main]doc
 docs/resources/parrot.css                                   [main]doc
@@ -1829,139 +1829,7 @@
 languages/parrot_compiler/sample.pasm                       [parrot_compiler]
 languages/parrot_compiler/t/basic/hello.t                   [parrot_compiler]
 languages/parrot_compiler/t/harness                         [parrot_compiler]
-languages/perl6/Configure.pl                                [perl6]
-languages/perl6/MAINTAINER                                  [perl6]
 languages/perl6/README                                      [perl6]
-languages/perl6/ROADMAP                                     [perl6]
-languages/perl6/Test.pm                                     [perl6]
-languages/perl6/build/gen_builtins_pir.pl                   [perl6]
-languages/perl6/build/gen_junction_pir.pl                   [perl6]
-languages/perl6/build/gen_metaop_pir.pl                     [perl6]
-languages/perl6/build/gen_objectref_pmc.pl                  [perl6]
-languages/perl6/config/makefiles/root.in                    [perl6]
-languages/perl6/config/makefiles/utils.in                   [perl6]
-languages/perl6/docs/STATUS                                 [perl6]
-languages/perl6/docs/compiler_overview.pod                  [perl6]
-languages/perl6/docs/glossary.pod                           [perl6]
-languages/perl6/docs/spectest-progress.csv                  [perl6]
-languages/perl6/perl6.pir                                   [perl6]
-languages/perl6/src/builtins/any-list.pir                   [perl6]
-languages/perl6/src/builtins/any-num.pir                    [perl6]
-languages/perl6/src/builtins/any-str.pir                    [perl6]
-languages/perl6/src/builtins/assign.pir                     [perl6]
-languages/perl6/src/builtins/cmp.pir                        [perl6]
-languages/perl6/src/builtins/control.pir                    [perl6]
-languages/perl6/src/builtins/enums.pir                      [perl6]
-languages/perl6/src/builtins/eval.pir                       [perl6]
-languages/perl6/src/builtins/globals.pir                    [perl6]
-languages/perl6/src/builtins/guts.pir                       [perl6]
-languages/perl6/src/builtins/io.pir                         [perl6]
-languages/perl6/src/builtins/match.pir                      [perl6]
-languages/perl6/src/builtins/math.pir                       [perl6]
-languages/perl6/src/builtins/misc.pir                       [perl6]
-languages/perl6/src/builtins/named-unary.pir                [perl6]
-languages/perl6/src/builtins/op.pir                         [perl6]
-languages/perl6/src/builtins/parrot.pir                     [perl6]
-languages/perl6/src/builtins/system.pir                     [perl6]
-languages/perl6/src/builtins/traits.pir                     [perl6]
-languages/perl6/src/classes/Abstraction.pir                 [perl6]
-languages/perl6/src/classes/Any.pir                         [perl6]
-languages/perl6/src/classes/Array.pir                       [perl6]
-languages/perl6/src/classes/Associative.pir                 [perl6]
-languages/perl6/src/classes/Block.pir                       [perl6]
-languages/perl6/src/classes/Bool.pir                        [perl6]
-languages/perl6/src/classes/Callable.pir                    [perl6]
-languages/perl6/src/classes/Capture.pir                     [perl6]
-languages/perl6/src/classes/ClassHOW.pir                    [perl6]
-languages/perl6/src/classes/Code.pir                        [perl6]
-languages/perl6/src/classes/Complex.pir                     [perl6]
-languages/perl6/src/classes/Exception.pir                   [perl6]
-languages/perl6/src/classes/Failure.pir                     [perl6]
-languages/perl6/src/classes/Grammar.pir                     [perl6]
-languages/perl6/src/classes/Hash.pir                        [perl6]
-languages/perl6/src/classes/IO.pir                          [perl6]
-languages/perl6/src/classes/Int.pir                         [perl6]
-languages/perl6/src/classes/Junction.pir                    [perl6]
-languages/perl6/src/classes/List.pir                        [perl6]
-languages/perl6/src/classes/Mapping.pir                     [perl6]
-languages/perl6/src/classes/Match.pir                       [perl6]
-languages/perl6/src/classes/Method.pir                      [perl6]
-languages/perl6/src/classes/Module.pir                      [perl6]
-languages/perl6/src/classes/Nil.pir                         [perl6]
-languages/perl6/src/classes/Num.pir                         [perl6]
-languages/perl6/src/classes/Object.pir                      [perl6]
-languages/perl6/src/classes/Order.pir                       [perl6]
-languages/perl6/src/classes/Pair.pir                        [perl6]
-languages/perl6/src/classes/Positional.pir                  [perl6]
-languages/perl6/src/classes/Protoobject.pir                 [perl6]
-languages/perl6/src/classes/Range.pir                       [perl6]
-languages/perl6/src/classes/Regex.pir                       [perl6]
-languages/perl6/src/classes/Role.pir                        [perl6]
-languages/perl6/src/classes/Routine.pir                     [perl6]
-languages/perl6/src/classes/Signature.pir                   [perl6]
-languages/perl6/src/classes/Str.pir                         [perl6]
-languages/perl6/src/classes/Sub.pir                         [perl6]
-languages/perl6/src/classes/Submethod.pir                   [perl6]
-languages/perl6/src/classes/Whatever.pir                    [perl6]
-languages/perl6/src/ops/perl6.ops                           [perl6]
-languages/perl6/src/parser/actions.pm                       [perl6]
-languages/perl6/src/parser/expression.pir                   [perl6]
-languages/perl6/src/parser/grammar-oper.pg                  [perl6]
-languages/perl6/src/parser/grammar.pg                       [perl6]
-languages/perl6/src/parser/methods.pir                      [perl6]
-languages/perl6/src/parser/quote_expression.pir             [perl6]
-languages/perl6/src/pmc/mutablevar.pmc                      [perl6]
-languages/perl6/src/pmc/objectref_pmc.template              [perl6]
-languages/perl6/src/pmc/perl6array.pmc                      [perl6]
-languages/perl6/src/pmc/perl6hash.pmc                       [perl6]
-languages/perl6/src/pmc/perl6multisub.pmc                   [perl6]
-languages/perl6/src/pmc/perl6scalar.pmc                     [perl6]
-languages/perl6/src/pmc/perl6str.pmc                        [perl6]
-languages/perl6/src/utils/perl6doc.pir                      [perl6]
-languages/perl6/src/utils/perl6doc/actions.pm               [perl6]
-languages/perl6/src/utils/perl6doc/grammar.pg               [perl6]
-languages/perl6/t/00-parrot/01-literals.t                   [perl6]
-languages/perl6/t/00-parrot/02-op-math.t                    [perl6]
-languages/perl6/t/00-parrot/03-op-logic.t                   [perl6]
-languages/perl6/t/00-parrot/04-op-cmp.t                     [perl6]
-languages/perl6/t/00-parrot/05-var-array.t                  [perl6]
-languages/perl6/t/00-parrot/05-var.t                        [perl6]
-languages/perl6/t/00-parrot/06-op-inplace.t                 [perl6]
-languages/perl6/t/00-parrot/07-op-string.t                  [perl6]
-languages/perl6/t/00-parrot/08-regex.t                      [perl6]
-languages/perl6/t/00-parrot/09-pir.t                        [perl6]
-languages/perl6/t/01-sanity/01-tap.t                        [perl6]
-languages/perl6/t/01-sanity/02-counter.t                    [perl6]
-languages/perl6/t/01-sanity/03-equal.t                      [perl6]
-languages/perl6/t/01-sanity/04-if.t                         [perl6]
-languages/perl6/t/01-sanity/05-sub.t                        [perl6]
-languages/perl6/t/01-sanity/06-use.t                        [perl6]
-languages/perl6/t/01-sanity/07-binding.t                    [perl6]
-languages/perl6/t/01-sanity/07-defined.t                    [perl6]
-languages/perl6/t/01-sanity/07-end-blocks.t                 [perl6]
-languages/perl6/t/01-sanity/07-for.t                        [perl6]
-languages/perl6/t/01-sanity/07-isa.t                        [perl6]
-languages/perl6/t/01-sanity/07-range.t                      [perl6]
-languages/perl6/t/01-sanity/07-ref.t                        [perl6]
-languages/perl6/t/01-sanity/07-simple-multisubs.t           [perl6]
-languages/perl6/t/01-sanity/07-split.t                      [perl6]
-languages/perl6/t/01-sanity/07-substr.t                     [perl6]
-languages/perl6/t/01-sanity/07-try.t                        [perl6]
-languages/perl6/t/01-sanity/08-say.t                        [perl6]
-languages/perl6/t/01-sanity/09-types.t                      [perl6]
-languages/perl6/t/harness                                   [perl6]
-languages/perl6/t/pmc/mutablevar.t                          [perl6]
-languages/perl6/t/pmc/objectref.t                           [perl6]
-languages/perl6/t/pmc/perl6multisub-arity.t                 [perl6]
-languages/perl6/t/pmc/perl6multisub-basic.t                 [perl6]
-languages/perl6/t/pmc/perl6multisub-tiebreak.t              [perl6]
-languages/perl6/t/pmc/perl6multisub-type.t                  [perl6]
-languages/perl6/t/spectest.data                             [perl6]
-languages/perl6/tools/autounfudge.pl                        [perl6]
-languages/perl6/tools/progress-graph.pl                     [perl6]
-languages/perl6/tools/rebase-rakudo.pl                      [perl6]
-languages/perl6/tools/test_summary.pl                       [perl6]
-languages/perl6/tools/update_passing_test_data.pl           [perl6]
 languages/pheme/Configure.pl                                [pheme]
 languages/pheme/MAINTAINER                                  [pheme]
 languages/pheme/MANIFEST                                    [pheme]
@@ -2657,8 +2525,6 @@
 runtime/parrot/library/yaml_dumper.pir                      [library]
 src/atomic/gcc_x86.c                                        []
 src/atomic/sparc_v9.s                                       []
-src/bignum.c                                                []
-src/bignum.h                                                []
 src/byteorder.c                                             []
 src/datatypes.c                                             []
 src/debug.c                                                 []
@@ -2672,6 +2538,7 @@
 src/dynpmc/foo.pmc                                          []
 src/dynpmc/gdbmhash.pmc                                     []
 src/dynpmc/main.pasm                                        []
+src/dynpmc/pair.pmc                                         []
 src/dynpmc/rational.pmc                                     []
 src/dynpmc/rotest.pmc                                       []
 src/dynpmc/subproxy.pmc                                     []
@@ -2796,15 +2663,16 @@
 src/packout.c                                               []
 src/parrot_debugger.c                                       []
 src/pbc_disassemble.c                                       []
+src/pbc_dump.c                                              []
 src/pbc_info.c                                              []
 src/pbc_merge.c                                             []
-src/pdump.c                                                 []
 src/pic.c                                                   []
 src/pic_jit.c                                               []
 src/pmc.c                                                   []
 src/pmc/addrregistry.pmc                                    []
 src/pmc/array.pmc                                           []
 src/pmc/bigint.pmc                                          []
+src/pmc/bignum.pmc                                          []
 src/pmc/boolean.pmc                                         []
 src/pmc/bound_nci.pmc                                       []
 src/pmc/callsignature.pmc                                   []
@@ -3101,6 +2969,7 @@
 t/dynpmc/dynlexpad.t                                        []
 t/dynpmc/foo.t                                              []
 t/dynpmc/gdbmhash.t                                         []
+t/dynpmc/pair.t                                             []
 t/dynpmc/rational.t                                         []
 t/dynpmc/rotest.t                                           []
 t/dynpmc/subclass_with_pir_method.t                         []
@@ -3167,7 +3036,9 @@
 t/native_pbc/string.t                                       []
 t/native_pbc/string_1.pbc                                   []
 t/native_pbc/string_2.pbc                                   []
+t/oo/attributes.t                                           []
 t/oo/composition.t                                          []
+t/oo/inheritance.t                                          []
 t/oo/isa.t                                                  []
 t/oo/metamodel.t                                            []
 t/oo/methods.t                                              []
@@ -3237,7 +3108,6 @@
 t/pmc/addrregistry.t                                        []
 t/pmc/array.t                                               []
 t/pmc/bigint.t                                              []
-t/pmc/bignum.t                                              []
 t/pmc/boolean.t                                             []
 t/pmc/bound_nci.t                                           []
 t/pmc/callsignature.t                                       []
@@ -3508,7 +3378,7 @@
 tools/dev/parrot_coverage.pl                                [devel]
 tools/dev/parrotbench.pl                                    [devel]
 tools/dev/pbc_header.pl                                     [devel]
-tools/dev/pbc_to_exe_gen.pl                                 [devel]
+tools/dev/pbc_to_exe.pir                                    [devel]
 tools/dev/pmcrenumber.pl                                    [devel]
 tools/dev/pmctree.pl                                        [devel]
 tools/dev/reconfigure.pl                                    [devel]

Modified: branches/vtable_morph_change/MANIFEST.SKIP
==============================================================================
--- branches/vtable_morph_change/MANIFEST.SKIP	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/MANIFEST.SKIP	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Feb  1 22:48:40 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Sun Feb  8 18:48:22 2009 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for
@@ -421,6 +421,10 @@
 ^languages/pjs/
 ^languages/primitivearc$
 ^languages/primitivearc/
+^languages/rakudo$
+^languages/rakudo/
+^languages/shakespeare$
+^languages/shakespeare/
 ^languages/tcl$
 ^languages/tcl/
 ^languages/test_regex\.pbc$
@@ -890,76 +894,6 @@
 ^languages/perl6/perl6\.exe\.manifest/
 ^languages/perl6/util$
 ^languages/perl6/util/
-# generated from svn:ignore of 'languages/perl6/src/'
-^languages/perl6/src/.*\.pbc$
-^languages/perl6/src/.*\.pbc/
-^languages/perl6/src/gen_.*\.pir$
-^languages/perl6/src/gen_.*\.pir/
-# generated from svn:ignore of 'languages/perl6/src/ops/'
-^languages/perl6/src/ops/.*\.bundle$
-^languages/perl6/src/ops/.*\.bundle/
-^languages/perl6/src/ops/.*\.c$
-^languages/perl6/src/ops/.*\.c/
-^languages/perl6/src/ops/.*\.dll$
-^languages/perl6/src/ops/.*\.dll/
-^languages/perl6/src/ops/.*\.exp$
-^languages/perl6/src/ops/.*\.exp/
-^languages/perl6/src/ops/.*\.h$
-^languages/perl6/src/ops/.*\.h/
-^languages/perl6/src/ops/.*\.ilk$
-^languages/perl6/src/ops/.*\.ilk/
-^languages/perl6/src/ops/.*\.lib$
-^languages/perl6/src/ops/.*\.lib/
-^languages/perl6/src/ops/.*\.manifest$
-^languages/perl6/src/ops/.*\.manifest/
-^languages/perl6/src/ops/.*\.o$
-^languages/perl6/src/ops/.*\.o/
-^languages/perl6/src/ops/.*\.obj$
-^languages/perl6/src/ops/.*\.obj/
-^languages/perl6/src/ops/.*\.pdb$
-^languages/perl6/src/ops/.*\.pdb/
-^languages/perl6/src/ops/.*\.so$
-^languages/perl6/src/ops/.*\.so/
-# generated from svn:ignore of 'languages/perl6/src/pmc/'
-^languages/perl6/src/pmc/.*\.bundle$
-^languages/perl6/src/pmc/.*\.bundle/
-^languages/perl6/src/pmc/.*\.c$
-^languages/perl6/src/pmc/.*\.c/
-^languages/perl6/src/pmc/.*\.dll$
-^languages/perl6/src/pmc/.*\.dll/
-^languages/perl6/src/pmc/.*\.dump$
-^languages/perl6/src/pmc/.*\.dump/
-^languages/perl6/src/pmc/.*\.exp$
-^languages/perl6/src/pmc/.*\.exp/
-^languages/perl6/src/pmc/.*\.h$
-^languages/perl6/src/pmc/.*\.h/
-^languages/perl6/src/pmc/.*\.ilk$
-^languages/perl6/src/pmc/.*\.ilk/
-^languages/perl6/src/pmc/.*\.lib$
-^languages/perl6/src/pmc/.*\.lib/
-^languages/perl6/src/pmc/.*\.manifest$
-^languages/perl6/src/pmc/.*\.manifest/
-^languages/perl6/src/pmc/.*\.o$
-^languages/perl6/src/pmc/.*\.o/
-^languages/perl6/src/pmc/.*\.obj$
-^languages/perl6/src/pmc/.*\.obj/
-^languages/perl6/src/pmc/.*\.pdb$
-^languages/perl6/src/pmc/.*\.pdb/
-^languages/perl6/src/pmc/.*\.so$
-^languages/perl6/src/pmc/.*\.so/
-^languages/perl6/src/pmc/objectref\.pmc$
-^languages/perl6/src/pmc/objectref\.pmc/
-# generated from svn:ignore of 'languages/perl6/src/utils/'
-^languages/perl6/src/utils/Makefile$
-^languages/perl6/src/utils/Makefile/
-# generated from svn:ignore of 'languages/perl6/src/utils/perl6doc/'
-^languages/perl6/src/utils/perl6doc/gen_.*\.pir$
-^languages/perl6/src/utils/perl6doc/gen_.*\.pir/
-# generated from svn:ignore of 'languages/perl6/t/'
-^languages/perl6/t/localtest\.data$
-^languages/perl6/t/localtest\.data/
-^languages/perl6/t/spec$
-^languages/perl6/t/spec/
 # generated from svn:ignore of 'languages/pheme/'
 ^languages/pheme/.*\.pbc$
 ^languages/pheme/.*\.pbc/

Modified: branches/vtable_morph_change/MANIFEST.generated
==============================================================================
--- branches/vtable_morph_change/MANIFEST.generated	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/MANIFEST.generated	Tue Feb 10 02:09:33 2009	(r36517)
@@ -66,16 +66,18 @@
 installable_parrot_debugger.exe                   [main]bin
 installable_pbc_disassemble                       [main]bin
 installable_pbc_disassemble.exe                   [main]bin
+installable_pbc_dump                              [main]bin
+installable_pbc_dump.exe                          [main]bin
 installable_pbc_info                              [main]bin
 installable_pbc_info.exe                          [main]bin
 installable_pbc_merge                             [main]bin
 installable_pbc_merge.exe                         [main]bin
-installable_pdump                                 [main]bin
-installable_pdump.exe                             [main]bin
 libparrot.dll                                     [main]bin
 parrot.pc                                         [main]pkgconfig
 pbc_disassemble                                   [main]bin
 pbc_disassemble.exe                               [main]bin
+pbc_dump                                          [main]bin
+pbc_dump.exe                                      [main]bin
 pbc_info                                          [main]bin
 pbc_info.exe                                      [main]bin
 pbc_merge                                         [main]bin
@@ -84,10 +86,6 @@
 pbc_to_exe.exe                                    [main]bin
 pdb                                               [main]bin
 pdb.exe                                           [main]bin
-pdump                                             [main]bin
-pdump.exe                                         [main]bin
-perl6                                             [main]bin
-perl6.exe                                         [main]bin
 runtime/parrot/dynext/apl_group.bundle            [library]
 runtime/parrot/dynext/apl_group.dll               [library]
 runtime/parrot/dynext/apl_group.dylib             [library]
@@ -144,10 +142,6 @@
 runtime/parrot/dynext/match_group.dll             [library]
 runtime/parrot/dynext/match_group.dylib           [library]
 runtime/parrot/dynext/match_group.so              [library]
-runtime/parrot/dynext/perl6_group.bundle          [library]
-runtime/parrot/dynext/perl6_group.dll             [library]
-runtime/parrot/dynext/perl6_group.dylib           [library]
-runtime/parrot/dynext/perl6_group.so              [library]
 runtime/parrot/dynext/php_group.bundle            [library]
 runtime/parrot/dynext/php_group.dll               [library]
 runtime/parrot/dynext/php_group.dylib             [library]
@@ -164,26 +158,6 @@
 runtime/parrot/dynext/subproxy.dll                [library]
 runtime/parrot/dynext/subproxy.dylib              [library]
 runtime/parrot/dynext/subproxy.so                 [library]
-runtime/parrot/dynext/wmls_group.bundle           [library]
-runtime/parrot/dynext/wmls_group.dll              [library]
-runtime/parrot/dynext/wmls_group.dylib            [library]
-runtime/parrot/dynext/wmls_group.so               [library]
-runtime/parrot/dynext/wmls_ops.bundle             [library]
-runtime/parrot/dynext/wmls_ops.dll                [library]
-runtime/parrot/dynext/wmls_ops.dylib              [library]
-runtime/parrot/dynext/wmls_ops.so                 [library]
-runtime/parrot/dynext/wmls_ops_cg.bundle          [library]
-runtime/parrot/dynext/wmls_ops_cg.dll             [library]
-runtime/parrot/dynext/wmls_ops_cg.dylib           [library]
-runtime/parrot/dynext/wmls_ops_cg.so              [library]
-runtime/parrot/dynext/wmls_ops_cgp.bundle         [library]
-runtime/parrot/dynext/wmls_ops_cgp.dll            [library]
-runtime/parrot/dynext/wmls_ops_cgp.dylib          [library]
-runtime/parrot/dynext/wmls_ops_cgp.so             [library]
-runtime/parrot/dynext/wmls_ops_switch.bundle      [library]
-runtime/parrot/dynext/wmls_ops_switch.dll         [library]
-runtime/parrot/dynext/wmls_ops_switch.dylib       [library]
-runtime/parrot/dynext/wmls_ops_switch.so          [library]
 runtime/parrot/include/call_bits.pasm             [main]
 runtime/parrot/include/cclass.pasm                [main]
 runtime/parrot/include/config.fpmc                [main]
@@ -281,9 +255,7 @@
 languages/lua/random.pbc                          [main]
 languages/lua/sha1.pbc                            [main]
 languages/lua/uuid.pbc                            [main]
-languages/markdown/markdown.pbc                   [main]
 languages/ook/ook.pbc                             [main]
-languages/perl6/perl6.pbc                         [main]
 languages/pheme/pheme.pbc                         [main]
 languages/PIR/pirc.pbc                            [main]
 languages/pipp/pipp.pbc                           [main]

Modified: branches/vtable_morph_change/META.yml
==============================================================================
--- branches/vtable_morph_change/META.yml	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/META.yml	Tue Feb 10 02:09:33 2009	(r36517)
@@ -5,7 +5,7 @@
 ---
 name: parrot
 version: 0.9.0
-author: parrot-dev at parrot.org
+author: parrot-dev at lists.parrot.org
 abstract: a virtual machine designed for dynamic languages
 license: artistic2
 no_index:

Modified: branches/vtable_morph_change/README
==============================================================================
--- branches/vtable_morph_change/README	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/README	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,7 +1,7 @@
 This is Parrot, version 0.9.0
 ------------------------------
 
-Parrot is Copyright (C) 2001-2009, The Perl Foundation.
+Parrot is Copyright (C) 2001-2009, Parrot Foundation.
 
 $Id$
 
@@ -121,7 +121,7 @@
 MAILING LISTS
 -------------
 
-The mailing list for parrot is parrot-dev at parrot.org. Subscribe by 
+The mailing list for parrot is parrot-dev at lists.parrot.org. Subscribe by 
 filling out the form at http://lists.parrot.org/mailman/listinfo/parrot-dev
 It is archived at http://lists.parrot.org/pipermail/parrot-dev/
 

Modified: branches/vtable_morph_change/README_win32.pod
==============================================================================
--- branches/vtable_morph_change/README_win32.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/README_win32.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -235,7 +235,7 @@
 =back
 
 This document is maintained by The Parrot Developers
-(E<lt>parrot-porters at perl.orgE<gt>).
+(E<lt>parrot-dev at lists.parrot.orgE<gt>).
 
 =head1 SEE ALSO
 

Modified: branches/vtable_morph_change/config/auto/format.pm
==============================================================================
--- branches/vtable_morph_change/config/auto/format.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/config/auto/format.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -15,6 +15,7 @@
 
 use strict;
 use warnings;
+use Config;  # for long double printf format
 
 use base qw(Parrot::Configure::Step);
 
@@ -115,7 +116,13 @@
         # Stay way from long double for now (it may be 64 or 80 bits)
         # die "long double not supported at this time, use double.";
         $nvsize   = $ldsize;
-        $nvformat = "%Lf";
+        if (defined($Config{'sPRIgldbl'})) {
+            $nvformat = "%.15" .  $Config{'sPRIgldbl'};
+            $nvformat =~ s/"//g;   # Perl 5's Config value has embedded double quotes
+        }
+        else {
+            die qq{Configure.pl:  Can't find a printf-style format specifier for type '$nv'\n};
+        }
     }
     else {
         die qq{Configure.pl:  Can't find a printf-style format specifier for type '$nv'\n};

Modified: branches/vtable_morph_change/config/gen/languages.pm
==============================================================================
--- branches/vtable_morph_change/config/gen/languages.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/config/gen/languages.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -44,7 +44,7 @@
         jako json
         lisp lolcode lua
         ook
-        parrot_compiler perl6 pheme PIR pipp punie pynie
+        parrot_compiler pheme PIR pipp punie pynie
         pod
         regex
         scheme squaak
@@ -73,10 +73,6 @@
             $conf->genfile("$langdir/config/makefiles/root.in"     => "$langdir/Makefile");
             $conf->genfile("$langdir/config/makefiles/cpp.in"      => "$langdir/src/cpp/Makefile");
         }
-        elsif ( $language eq 'perl6' ) {
-            $conf->genfile("$langdir/config/makefiles/root.in"     => "$langdir/Makefile");
-            $conf->genfile("$langdir/config/makefiles/utils.in"    => "$langdir/src/utils/Makefile");
-        }
         else {
             $conf->genfile("$langdir/config/makefiles/root.in"     => "$langdir/Makefile"
             );

Modified: branches/vtable_morph_change/config/gen/makefiles/dynoplibs_pl.in
==============================================================================
--- branches/vtable_morph_change/config/gen/makefiles/dynoplibs_pl.in	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/config/gen/makefiles/dynoplibs_pl.in	Tue Feb 10 02:09:33 2009	(r36517)
@@ -39,10 +39,8 @@
 if ($^O eq 'MSWin32') {
     # Paths need quoting as they may contain spaces.
     $PATHQUOTE = q["];
-
-    unless ($CC =~ /gcc/i) {
-        $LIBPARROT = '@build_dir@/libparrot at a@';
-    }
+    # absolute because we are building in src\dynoplibs
+    $LIBPARROT = '@build_dir@/libparrot.lib'; # the importlib, not the static one
 }
 
 # OPS2C Config

Modified: branches/vtable_morph_change/config/gen/makefiles/dynpmc.in
==============================================================================
--- branches/vtable_morph_change/config/gen/makefiles/dynpmc.in	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/config/gen/makefiles/dynpmc.in	Tue Feb 10 02:09:33 2009	(r36517)
@@ -14,6 +14,7 @@
 PMCS = \
   dynlexpad \
   foo \
+  pair \
   rotest \
 #IF(has_gdbm):  gdbmhash \
   rational \

Modified: branches/vtable_morph_change/config/gen/makefiles/dynpmc_pl.in
==============================================================================
--- branches/vtable_morph_change/config/gen/makefiles/dynpmc_pl.in	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/config/gen/makefiles/dynpmc_pl.in	Tue Feb 10 02:09:33 2009	(r36517)
@@ -15,25 +15,25 @@
 
 use strict;
 use warnings;
-
-use File::Copy qw(copy);
 use FindBin;
 use lib "$FindBin::Bin/../..";
 use lib "$FindBin::Bin/../../lib";
+
+use File::Copy qw(copy);
 use Storable;
 
+# Config stuff
 # q[] isn't guaranteed to work, but it's safer than "" as some platforms
-# (eg FreeBSD) have ""s embedded in their substution values. q[] is used
+# (eg FreeBSD) have ""s embedded in their substitution values. q[] is used
 # as Win32 paths have \'s in, which qq treats as escape sequences.
-# Config stuff
-our $CC = q[@cc@ -c];
-our $LD = q[@ld@];
-our $LDFLAGS = q[@ldflags@ @ld_debug@ @rpath_blib@ @linkflags@];
-our $LD_LOAD_FLAGS = q[@ld_load_flags@];
-our $PERL = q[@perl@];
-our $LOAD_EXT = q[@load_ext@];
-our $O = q[@o@];
-our $CFLAGS = q[@ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@];
+our $CC              = q[@cc@ -c];
+our $LD              = q[@ld@];
+our $LDFLAGS         = q[@ldflags@ @ld_debug@ @rpath_blib@];
+our $LD_LOAD_FLAGS   = q[@ld_load_flags@];
+our $PERL            = q[@perl@];
+our $LOAD_EXT        = q[@load_ext@];
+our $O               = q[@o@];
+our $CFLAGS          = q[@ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@];
 
 our $LIBPARROT = q[];
 #IF(parrot_is_shared):$LIBPARROT = q[@libparrot_ldflags@];
@@ -43,10 +43,8 @@
 if ($^O eq 'MSWin32') {
     # Paths need quoting as they may contain spaces.
     $PATHQUOTE = '"';
-
-    unless ($CC =~ /gcc/i) {
-        $LIBPARROT = '@build_dir@/libparrot at a@';
-    }
+    # absolute because we are building in src\dynoplibs
+    $LIBPARROT = '@build_dir@/libparrot.lib'; # the importlib, not the static one
 }
 
 # PMC2C Config
@@ -65,7 +63,7 @@
     }
 
 
-    # XXX Reference to BGC - need long term solution for passing in include paths
+    # TT #288 - need long term solution for passing in include paths
     return
         "$CC " .
         '@cc_o_out@' . $target . " " .
@@ -205,7 +203,7 @@
     return system(@_) == 0;
 }
 
-# XXX: ordering of libs might be crucial
+# TT #289: ordering of libs might be crucial
 sub gather_groups_and_libs {
     my @pmcs = @_;
 

Modified: branches/vtable_morph_change/config/gen/makefiles/languages.in
==============================================================================
--- branches/vtable_morph_change/config/gen/makefiles/languages.in	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/config/gen/makefiles/languages.in	Tue Feb 10 02:09:33 2009	(r36517)
@@ -9,6 +9,7 @@
 BUILD_DIR     = @build_dir@
 RECONFIGURE   = $(PERL) @build_dir@/tools/dev/reconfigure.pl
 GIT           = git
+HG            = hg
 SVN           = svn
 
 # List of languages that are currently managed in the Parrot svn repository
@@ -23,7 +24,7 @@
     jako json \
     lisp lolcode lua \
     ook \
-    parrot_compiler perl6 pheme PIR pipp punie pynie \
+    parrot_compiler pheme PIR pipp punie pynie \
     regex \
     scheme squaak \
     urm
@@ -81,6 +82,10 @@
 	@echo ""
 	@echo "  co-primitivearc: Try to fetch primitivearc"
 	@echo ""
+	@echo "  co-rakudo:     Try to fetch Rakudo"
+	@echo ""
+	@echo "  co-shakespeare: Try to fetch shakespeare"
+	@echo ""
 	@echo "  co-tcl:        Try to fetch Partcl"
 	@echo ""
 	@echo "  co-unlambda:   Try to fetch unlambda"
@@ -102,6 +107,10 @@
 	@echo ""
 	@echo "  up-primitivearc: Try to update primitivearc"
 	@echo ""
+	@echo "  up-shakespeare: Try to update shakespeare"
+	@echo ""
+	@echo "  up-rakudo:     Try to update Rakudo"
+	@echo ""
 	@echo "  up-tcl:        Try to update Partcl"
 	@echo ""
 	@echo "  up-unlambda:   Try to update unlambda"
@@ -126,7 +135,7 @@
     jako.test json.test \
     lisp.test lolcode.test lua.test \
     ook.test \
-    parrot_compiler.test perl6.test pheme.test PIR.test pipp.test punie.test pynie.test \
+    parrot_compiler.test pheme.test PIR.test pipp.test punie.test pynie.test \
     regex.test \
     scheme.test squaak.test \
     urm.test
@@ -142,7 +151,7 @@
     lisp.clean \
     lolcode.clean lua.clean \
     ook.clean \
-    parrot_compiler.clean perl6.clean pheme.clean PIR.clean pipp.clean punie.clean pynie.clean \
+    parrot_compiler.clean pheme.clean PIR.clean pipp.clean punie.clean pynie.clean \
     regex.clean \
     scheme.clean squaak.clean \
     urm.clean
@@ -157,7 +166,7 @@
     jako.realclean json.realclean \
     lisp.realclean lolcode.realclean lua.realclean \
     ook.realclean \
-    parrot_compiler.realclean perl6.realclean pheme.realclean PIR.realclean pipp.realclean pod.realclean punie.realclean pynie.realclean \
+    parrot_compiler.realclean pheme.realclean PIR.realclean pipp.realclean pod.realclean punie.realclean pynie.realclean \
     regex.realclean \
     scheme.realclean squaak.realclean \
     urm.realclean
@@ -358,16 +367,6 @@
 parrot_compiler.realclean:
 	- $(MAKE) parrot_compiler realclean
 
-perl6 : perl6.dummy
-perl6.dummy:
-	- $(MAKE) perl6
-perl6.test:
-	- $(MAKE) perl6 test
-perl6.clean:
-	- $(MAKE) perl6 clean
-perl6.realclean:
-	- $(MAKE) perl6 realclean
-
 pheme : pheme.dummy
 pheme.dummy:
 	- $(MAKE) pheme
@@ -471,8 +470,10 @@
 # helpers for checking out externally managed languages
 
 # check out all known externally managed languages
-co-all: co-eclectus co-gil co-hq9plus co-lazy-k co-m4 co-markdown co-pjs co-primitivearc co-tcl co-unlambda co-wmlscript
-up-all: up-eclectus up-gil up-hq9plus up-lazy-k up-m4 up-markdown up-pjs up-primitivearc up-tcl up-unlambda up-wmlscript
+co-all: co-eclectus co-gil co-hq9plus co-lazy-k co-m4 co-markdown co-pjs \
+    co-primitivearc co-rakudo co-shakespeare co-tcl co-unlambda co-wmlscript
+up-all: up-eclectus up-gil up-hq9plus up-lazy-k up-m4 up-markdown up-pjs \
+    up-primitivearc up-rakudo up-shakespeare up-tcl up-unlambda up-wmlscript
 
 co-eclectus:
 	- $(GIT) clone 'git:////github.com//bschmalhofer//eclectus.git'
@@ -522,6 +523,18 @@
 up-primitivearc:
 	cd primitivearc && $(GIT) pull
 
+co-shakespeare:
+	- $(HG) clone 'http:////bitbucket.org//riffraff//shakespeare-parrot' shakespeare
+
+up-shakespeare:
+	cd shakespeare && $(HG) pull
+
+co-rakudo:
+	- $(GIT) clone 'git:////github.com//rakudo//rakudo.git'
+
+up-rakudo:
+	cd rakudo && $(GIT) pull
+
 co-tcl:
 	- $(SVN) checkout 'http:////partcl.googlecode.com//svn//trunk' tcl
 

Modified: branches/vtable_morph_change/config/gen/makefiles/root.in
==============================================================================
--- branches/vtable_morph_change/config/gen/makefiles/root.in	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/config/gen/makefiles/root.in	Tue Feb 10 02:09:33 2009	(r36517)
@@ -20,6 +20,8 @@
 VERSION         = @VERSION@$(DEVEL)
 SOVERSION       = @VERSION@
 
+CONFIG_ARGS     = @configure_args@
+
 # Override at least PREFIX with the install location if you're going
 # to be using this outside of your build area.
 BUILDPREFIX     =
@@ -458,25 +460,21 @@
 PARROT              = $(CUR_DIR)/@test_prog@$(EXE)
 MINIPARROT          = $(CUR_DIR)/miniparrot$(EXE)
 DIS                 = $(CUR_DIR)/pbc_disassemble$(EXE)
-PDUMP               = $(CUR_DIR)/pdump$(EXE)
+PDUMP               = $(CUR_DIR)/pbc_dump$(EXE)
 PINFO               = $(CUR_DIR)/pbc_info$(EXE)
 PBCMERGE            = $(CUR_DIR)/pbc_merge$(EXE)
 PDB                 = $(CUR_DIR)/parrot_debugger$(EXE)
 PBC_TO_EXE          = $(CUR_DIR)/pbc_to_exe$(EXE)
 PARROT_CONFIG       = $(CUR_DIR)/parrot_config$(EXE)
 
-# HLL Executables
-PERL6               = $(CUR_DIR)/perl6$(EXE)
-
 # Installable executables
 INSTALLABLEPARROT   = $(CUR_DIR)/installable_parrot$(EXE)
 INSTALLABLEDIS      = $(CUR_DIR)/installable_pbc_disassemble$(EXE)
-INSTALLABLEPDUMP    = $(CUR_DIR)/installable_pdump$(EXE)
+INSTALLABLEPDUMP    = $(CUR_DIR)/installable_pbc_dump$(EXE)
 INSTALLABLEPINFO    = $(CUR_DIR)/installable_pbc_info$(EXE)
 INSTALLABLEPBCMERGE = $(CUR_DIR)/installable_pbc_merge$(EXE)
 INSTALLABLEPDB      = $(CUR_DIR)/installable_parrot_debugger$(EXE)
 INSTALLABLECONFIG   = $(CUR_DIR)/installable_parrot_config$(EXE)
-INSTALLABLEPERL6    = $(CUR_DIR)/installable_perl6$(EXE)
 
 # Libraries
 LIBPARROT_STATIC    = @blib_dir@/@libparrot_static@
@@ -644,10 +642,6 @@
 	@echo " $(PARROT_CONFIG):"
 	@echo "                     Provide Parrot configuration information"
 	@echo ""
-	@echo "HLL Executables:"
-	@echo " $(PERL6):"
-	@echo "                     Generate C, compile, and link the Rakudo compiler"
-	@echo ""
 	@echo "Installation:"
 	@echo "  install:           Install under '$(PREFIX)' on Unix systems"
 	@echo ""
@@ -742,7 +736,7 @@
 
 parrot_utils : $(PDUMP) $(DIS) $(PINFO) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG)
 
-installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPINFO) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLECONFIG) $(INSTALLABLEPERL6)
+installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPINFO) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLECONFIG)
 
 
 flags_dummy :
@@ -764,32 +758,14 @@
 	@rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) $(LINK_DYNAMIC)
 #IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
 
-pbc_to_exe.pir : $(PARROT) tools/dev/pbc_to_exe_gen.pl
-	$(PERL) tools/dev/pbc_to_exe_gen.pl \
-    > pbc_to_exe.pir
-
-$(PBC_TO_EXE) : pbc_to_exe.pir $(PARROT)
-	$(PARROT) -o pbc_to_exe.pbc pbc_to_exe.pir
-	$(PARROT) pbc_to_exe.pir pbc_to_exe.pbc
+$(PBC_TO_EXE) : tools/dev/pbc_to_exe.pir $(PARROT)
+	$(PARROT) -o pbc_to_exe.pbc tools/dev/pbc_to_exe.pir
+	$(PARROT) pbc_to_exe.pbc pbc_to_exe.pbc
 
 $(PARROT_CONFIG) : tools/util/parrot-config.pir $(PARROT) $(PBC_TO_EXE)
 	$(PARROT) -o parrot_config.pbc tools/util/parrot-config.pir
 	$(PARROT) pbc_to_exe.pbc parrot_config.pbc
 
-# HLL Executable targets
-#IF(win32):perl6 : $(PERL6)
-
-$(PERL6) : compilers $(PBC_TO_EXE)
-	$(MAKE) languages/perl6 perl6$(EXE)
-	$(CP) languages/perl6/perl6$(EXE) $(PERL6)
-	$(CHMOD) 0755 $(PERL6)
-	$(PERL6) -e"say 'Hello, world.'"
-
-$(INSTALLABLEPERL6) : $(PERL6)
-	$(MAKE) languages/perl6 installable_perl6$(EXE)
-	$(CP) languages/perl6/installable_perl6$(EXE) $(INSTALLABLEPERL6)
-	$(CHMOD) 0755 $(INSTALLABLEPERL6)
-
 $(MINIPARROT) : $(SRC_DIR)/main$(O) $(GEN_HEADERS) $(LIBPARROT) \
     lib/Parrot/OpLib/core.pm $(SRC_DIR)/null_config$(O)
 	$(LINK) @ld_out@$@ $(SRC_DIR)/main$(O) $(SRC_DIR)/null_config$(O) \
@@ -925,17 +901,17 @@
 # Parrot Dump
 #
 
-$(PDUMP) : $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
+$(PDUMP) : $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
-    $(SRC_DIR)/pdump$(O) \
+    $(SRC_DIR)/pbc_dump$(O) \
     $(SRC_DIR)/packdump$(O) @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
 #IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
 
-$(SRC_DIR)/pdump$(O) : $(GEN_HEADERS)
+$(SRC_DIR)/pbc_dump$(O) : $(GEN_HEADERS)
 
-$(INSTALLABLEPDUMP) : $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
+$(INSTALLABLEPDUMP) : $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) $(LIBPARROT)
 	$(LINK) @ld_out@$@ \
-    $(SRC_DIR)/pdump$(O) \
+    $(SRC_DIR)/pbc_dump$(O) \
     $(SRC_DIR)/packdump$(O) \
     @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS)
 #IF(win32):	if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
@@ -1617,10 +1593,9 @@
     $(INSTALLABLEPINFO) \
     $(INSTALLABLEPBCMERGE) \
     $(INSTALLABLEPDB) \
-    pbc_to_exe.pir pbc_to_exe.pbc pbc_to_exe.c pbc_to_exe$(O) pbc_to_exe$(EXE) \
-    $(PERL6) \
+    pbc_to_exe.pbc pbc_to_exe.c pbc_to_exe$(O) pbc_to_exe$(EXE) \
     $(IMCC_DIR)/main$(O) \
-    $(PDUMP) $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) \
+    $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \
     $(SRC_DIR)/pbc_info$(O) $(PINFO) \
     $(PDB) $(SRC_DIR)/parrot_debugger$(O) \
     $(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \
@@ -1657,7 +1632,7 @@
     $(INSTALLABLEPDB) \
     $(INSTALLABLECONFIG) \
     $(IMCC_DIR)/main$(O) \
-    $(PDUMP) $(SRC_DIR)/pdump$(O) $(SRC_DIR)/packdump$(O) \
+    $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \
     $(SRC_DIR)/pbc_info$(O) $(PINFO) \
     $(PDB) $(SRC_DIR)/parrot_debugger$(O) \
     $(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \
@@ -1766,8 +1741,8 @@
 svnclobber : .svn
 	$(PERL) tools/dev/svnclobber.pl
 
-reconfig : clean
-	$(PERL) Configure.pl
+reconfig : realclean
+	$(PERL) Configure.pl $(CONFIG_ARGS)
 
 manitest :
 	$(PERL) tools/dev/manicheck.pl
@@ -2187,13 +2162,13 @@
 # for use by t/pmc/nci.t
 $(LIBNCI_TEST_SO): $(SRC_DIR)/nci_test$(O)
 	$(LD) $(LD_LOAD_FLAGS) @ncilib_link_extra@ $(LDFLAGS) \
-    @ld_out@$@ $(SRC_DIR)/nci_test$(O) $(C_LIBS) $(LINKFLAGS)
+    @ld_out@$@ $(SRC_DIR)/nci_test$(O) $(C_LIBS)
 
 # for use by runtime/parrot/library/OpenGL.pir
 $(LIBGLUTCB_SO): $(LIBPARROT) $(SRC_DIR)/glut_callbacks$(O)
 	$(LD) $(LD_LOAD_FLAGS) $(LDFLAGS) \
     @ld_out@$@ $(SRC_DIR)/glut_callbacks$(O) \
-    $(ALL_PARROT_LIBS) @opengl_lib@ $(LINKFLAGS)
+    $(ALL_PARROT_LIBS) @opengl_lib@
 
 # emacs etags
 # this needs exuberant-ctags

Modified: branches/vtable_morph_change/config/init/hints/mswin32.pm
==============================================================================
--- branches/vtable_morph_change/config/init/hints/mswin32.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/config/init/hints/mswin32.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -239,7 +239,6 @@
             has_dynamic_linking => 1,
             ld_load_flags       => '-shared ',
             ld_share_flags      => '-shared ',
-            libparrot_ldflags   => "\"$build_dir\\libparrot.dll\"",
             ncilib_link_extra   => 'src/libnci_test.def',
             sym_export          => '__declspec(dllexport)',
             sym_import          => '__declspec(dllimport)',

Modified: branches/vtable_morph_change/docs/book/README
==============================================================================
--- branches/vtable_morph_change/docs/book/README	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/README	Tue Feb 10 02:09:33 2009	(r36517)
@@ -4,23 +4,17 @@
 
  1) Overview
  2) Getting Started
- 3) PIR Basics
- 4) PIR Subroutines
- 5) PASM
- 6) Standard Library
- 7) Testing and Debugging
- 8) Parrot Architecture
- 9) Parrot Compiler Tools
-10) High-Level Languages
-11) PMCs
-12) Opcodes and Runcores
-13) NCI (proposed, if there is enough material about using NCI to warrant a chapter)
-14) Reference
+ 3) High-Level Languages
+ 4) Parrot Compiler Tools
+ 5) Parrot Intermediate Representation (PIR)
+ 6) Parrot Assembly Language (PASM)
+ 7) Writing your own PMCs
+ 8) Testing and Debugging
+ 9) Standard Library (maybe)
 
 This list will probably change as time goes on, as more topics need to be
-covered. I'm sure other authors are going to think it's stupid and completely
-rearrange it to be better.
+covered.
 
-Top-level headings in each chapter are level1 headings. All sub-headings in the chapter
-are level 2 and below. All pages in the book should contain the VIM suffix (which is
-a codingstd for all of the Parrot repo) and the Pseudopod cheatsheet.
+Top-level headings in each chapter (the chapter title) are level 1 headings.
+All sub-headings in the chapter are level 2 and below. All chapter files should
+contain the VIM suffix (which is a codingstd for all of the Parrot repo).

Copied: branches/vtable_morph_change/docs/book/appX_patch_submission.pod (from r36514, trunk/docs/book/appX_patch_submission.pod)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/vtable_morph_change/docs/book/appX_patch_submission.pod	Tue Feb 10 02:09:33 2009	(r36517, copy of r36514, trunk/docs/book/appX_patch_submission.pod)
@@ -0,0 +1,133 @@
+=pod
+
+=head1 Patch submission
+
+X<Parrot;patch submission>
+Parrot development proceeds through a continuous stream of patches.
+Patches are the currency of exchange in the project--the unit of
+work. Patches can fix bugs, add features, modify capabilities,
+remove cruft, and improve the suite of tests and the project
+documentation. If something needs to change, it will typically require
+the submission of a new patch.
+
+While anyone is free to submit a patch, only a small number of people have
+the ability to apply patches to the central Parrot repository.
+These people are called I<committers>. By allowing all people to get
+involved through patch submission and testing, the project can harness
+the efforts of a large group but still keep the same high quality
+as a small group of experienced developers.
+
+Every submitted patch is automatically forwarded to the p2 list where
+it's subject to peer review. Small patches typically spark little debate,
+and can be well-tested on many platforms before being committed to the
+repository. Patches tend to be small modular changes, which makes for
+easy testing and evaluation. Occasionally a large feature such as an entire
+language implementation is submitted in a single patch, but these are the
+exceptions.
+
+Submitting a patch is fairly straightforward. You create a file that
+lists all your changes, a diff or a patch, and email it to the ticket
+tracking system at U<parrotbug at parrotcode.org>. It's important to make
+sure your patch and your email have descriptive titles so that the
+committers and testers have a better idea about what it does. The body of
+your email should also include a good description about what you changed
+and why.
+
+It's important that you create your patches from a checked-out subversion
+repository, not from a tarball or a snapshot. This way, you can ensure
+that your diff is made against the latest version of the files. If you patch
+an old version, the problem may have already been resolved! Make sure
+the paths listed in the patch match those in the repository. There are two
+methods of creating patches that will do this for you. You can make changes
+directly in your checked-out copy of the subversion repository and
+then create diffs using the command C<svn diff>. Alternatively, you can
+make a copy of the repository and then create diffs between the two
+copies with the C<diff -u> command:
+
+  diff -u parrot/README parrot_changed/README
+
+Either method is fine, and both are equally common on p2. Your
+working style and the types of changes you make--small and modular
+versus large and sweeping--will influence which method you choose.
+
+Next, when you're making changes, take some extra time to consider how
+your patch affects the rest of the system. If your patch adds a new
+file, patch the main F<MANIFEST> file to include it. If you add a new
+feature, make sure to write tests for it. If you fix a bug, add a test
+to prove that it's fixed. See A<CHP-9-SECT-13>"Writing Tests" in Chapter
+9 for more on writing tests for Parrot. Tests are very important for
+Parrot development, and writing good tests is a valuable skill for
+developers to have. Before you submit a patch always recompile the
+system yourself with the patch included and run all tests to prove that
+it works. You can build and test Parrot completely by running the
+following commands:
+
+  make clean
+  perl Configure.pl
+  make
+  make test
+
+Consider the people who will review and apply your patch, and try
+to make their jobs easier. Patch filenames should be as descriptive as
+possible: F<fix_readme_aardvark_typo.patch> is far better than
+F<README.patch>. An attached file is better than a diff pasted into an
+email, because it can be applied without manual editing. The
+conventional extension for patch files is F<.patch>.
+
+In the email message, always start the subject with "[PATCH]", and
+make the subject as clear as possible: "[PATCH] misspelled aardvark in
+main README file" is better than "[PATCH] typo". The body of the
+message should clearly explain what the patch is supposed to do and
+why you're submitting it. Make a note if you're adding or deleting
+files so they won't be missed.
+
+Here is a good example of a patch submission using the subversion diff
+method (an actual patch from p2). It's short, sticks to the point, and
+clearly expresses the problem and the solution. The patch filename and
+the subject of the message are both descriptive:
+
+=for author
+
+Possible alternates: ticket #23501, #24053 (not from top level)
+
+=end for
+
+  Subject: [PATCH] Pointers in List_chunk not initialized
+  From: Bruce Gray
+  
+  On Win32, these tests are segfaulting due to invalid
+  pointers in List_chunk structs:
+  t/op/string.t             97-98
+  t/pmc/intlist.t           3-4
+  t/pmc/pmc.t               80
+  
+  The problem is caused by list.c/allocate_chunk not
+  initializing the pointers. This patch corrects the problem.
+  
+  --
+  Hope this helps,
+  Bruce Gray
+
+With the attached file F<list_chunk_initialize.patch>:
+
+
+  Index: list.c
+  =========================================
+  RCS file: /cvs/public/parrot/list.c,v
+  retrieving revision 1.23
+  diff -u -r1.23 list.c
+  --- list.c        27 Dec 2002 09:33:11 -0000        1.23
+  +++ list.c        28 Dec 2002 03:37:35 -0000
+  @@ -187,6 +187,10 @@
+       Parrot_block_GC_sweep(interpreter);
+       chunk = (List_chunk *)new_bufferlike_header(interpreter, sizeof(*chunk));
+       chunk->items = items;
+  +    chunk->n_chunks = 0;
+  +    chunk->n_items  = 0;
+  +    chunk->next     = NULL;
+  +    chunk->prev     = NULL;
+       Parrot_allocate_zeroed(interpreter, (Buffer *)chunk, size);
+       Parrot_unblock_GC_mark(interpreter);
+       Parrot_unblock_GC_sweep(interpreter);
+
+=cut

Deleted: branches/vtable_morph_change/docs/book/appendix.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/appendix.pod	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,15 +0,0 @@
-=pod
-
-=head0 ERRATA
-
-Parrot is continually evolving and the book does not keep pace. This is a list
-of known defects in the book. We'll clean up the book as soon as possible, but
-in the meantime, enjoy this map of some of the rough patches.
-
-=head1 Removed or Deprecated Features
-
-=over 4
-
-=back
-
-=cut

Modified: branches/vtable_morph_change/docs/book/ch01_overview.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch01_overview.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch01_overview.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -2,68 +2,12 @@
 
 =head1 Project Overview
 
-Z<CHP-1>
-
-X<Parrot>
-The heart of Parrot is a grandiose idea that turned out to be more
-realistic than anyone originally could have believed: why not have a
-single interpreter for several languages? Before this question was
-asked, dynamic languages such as Perl, Python, Ruby, and Scheme had
-all had their own individual interpreters; most of which were not
-easily extensible, not modular, and not capable of interoperation.
-The solution, it was decided, was to create a single virtual machine
-for all such languages. That virtual machine is called Parrot.
-
-On April 1st, 2001, Simon CozensX<Cozens, Simon> published an article
-titled "Programming Parrot" as an April Fools' joke
-(U<http://www.perl.com/pub/a/2001/04/01/parrot.htm>).  It contained a
-contrived interview with Larry Wall and Guido van Rossum detailing
-their plans to merge Python and Perl into a new language called
-Parrot. This was a plausible ruse because both languages were
-undergoing massive redesigns: The Perl community was laying the
-groundwork for the next version, "Perl 6", and the Python team was
-working hard on a spec for "Python 3000". The Perl 6 project started
-moving in two different directions at once: the underlying interpreter
-architecture and the language grammar and semantics. As people
-realized that the two projects could become completely independent, it
-was decided to create a proper language-agnostic virtual machine to
-support the high-level efforts. The virtual machine was later dubbed
-"Parrot" in a fitting turn of life imitating art.
-
-The goal for the Parrot project was to create a language-neutral runtime
-environment for dynamic languages like Perl and Python. Of course, these
-two languages weren't the end, not for the Parrot team. They were
-thinking big. Parrot would have to support all the features other
-dynamic languages such as Ruby, Scheme, Befunge, PHP, and others.
-Threading and Unicode would be supported from the start, mitigating two
-thorns that had plagued Perl 5 developers for years. A robust exceptions
-system, a capability to compile into platform-independent bytecode, and
-a clean extension and embedding mechanism would be just some of the
-necessary and standard features. Parrot needed to have more then any of
-these languages had ever had by themselves, and it needed to do all
-these things right.
-
-The irony is that the language-neutrality of the interpreter was
-originally just a side effect of good design. Keeping the implementation
-independent of the syntax would make the codebase cleaner and easier to
-maintain. Plus, the Parrot team could get to work long before the Perl
-6 group even had their plans written.
-
-Since Parrot would support the features of the major dynamic languages
-and wasn't biased to a particular syntax, it could run all these
-languages with little additional effort.  It's generally acknowledged
-that different languages are suited to different tasks, and picking which
-language to use in a large software project is a common planning problem.
-There's never a perfect fit, at least not for all jobs. Developers find
-themselves settling for the language with the most advantages and the
-least noticeable disadvantages. The ability to easily combine multiple
-languages within a single project could be a huge benefit to developers.
-Before Parrot, language interoperability was a feature typically reserved
-for compiled languages such as C. Using well-tested libraries from one
-language, taking advantage of clean problem-domain expression in a second,
-and using languages according to their inherent strengths is the ultimate
-goal, one which the Parrot team is hoping to make a reality.
+The heart of Parrot is a language-neutral runtime environment for
+dynamic languages, such as Ruby, Python, PHP and Perl.
 
+The language-neutrality of the interpreter is partially a design
+decision for modularity. Keeping the implementation independent of the
+syntax makes the codebase cleaner and easier to maintain.
 Modular design also benefits future language designers, not just
 designers of current languages. Instead of targeting I<lex>/I<yacc> and
 reimplementing low-level features such as garbage collection and dynamic
@@ -72,25 +16,40 @@
 Parrot does all the necessary bookkeeping, exposing a rich interface with
 capabilities that few languages can make full use of.
 
-=head1 The Parrot Team
+A robust exceptions system, a capability to compile into
+platform-independent bytecode, and a clean extension and embedding
+mechanism would be just some of the necessary and standard features.
+
+
+
+Since Parrot would support the features of the major dynamic languages
+and wasn't biased to a particular syntax, it could run all these
+languages with little additional effort.  
+
+Language interoperability is another core goal. Different languages are
+suited to different tasks, and picking which language to use in a large
+software project is a common planning problem.  There's never a perfect
+fit, at least not for all jobs. Developers find themselves settling for
+the language with the most advantages and the least noticeable
+disadvantages. The ability to easily combine multiple languages within a
+single project opens up the potential of using well-tested libraries
+from one language, taking advantage of clean problem-domain expression
+in a second, while binding it together in a third that elegantly
+captures the overall architecture. It's about using languages according
+to their inherent strengths, and mitigating the cost of their
+weaknesses.
+
+The name "Parrot" started with an April Fools' Day joke in 2001. Simon
+CozensX<Cozens, Simon> published an article titled "Programming Parrot",
+with a fictional interview between Larry Wall and Guido van Rossum
+detailing their plans to merge Python and Perl into a new language
+called Parrot (U<http://www.perl.com/pub/a/2001/04/01/parrot.htm>).
 
-As is typical of open source development projects, managing the
-development of Parrot is quite different from managing a commercial
-project of the same size and complexity.  There are no schedules, no
-deadlines, no hiring and firing, and no salaries, bonuses, or stock
-options. There are no employees or bosses; there is very little
-hierarchy whatsoever. Management in this context isn't about giving
-orders, it's about making sure everyone has what they need to keep
-moving forward. Like most open-source and open-content projects, the
-best leadership is to set a good example and stay out of the way.
+=head2 The Parrot Team
 
 The Parrot development team is broken down into several distinct roles,
 which people assume according to their merits and their talents. This is
-a list of those roles, with a partial list of the folks who have taken
-responsibility for them.
-
-=head2 Project Team
-X<Project Team>
+a list of those roles.
 
 =over 4
 
@@ -113,54 +72,15 @@
 according to the release schedule. The release schedule is developed
 and maintained jointly with the project Architect.
 
-Current release managers are, in this order:
-
-    Jerry Gay
-X<Gay, Jerry>
-    Patrick Michaud
-X<Michaud, Patrick>
-    Matt Diephouse
-X<Diephouse, Matt>
-    Will Coleda
-X<Coleda, Will>
-    chromatic
-X<chromatic>
-    Allison Randal
-X<Randal, Allison>
-
-Information on the release procedure can be found in
-F<docs/project/release_manager_guide.pod>. Parrot releases a stable
-version, under the direction of one of these release managers, every
-month.
-
 =item Metacommitter
 
 All Metacommitters are responsible for managing commit access to the
-Parrot repository. Once the Architect or Pumpking approves a request
-for a contributor to be given commit access, a Metacommitter performs
-the necessary magic to give the new committer access to the SVN
-repository and the bugtracker. The Architect is a Metacommitter, but
-other Project Team members may also hold this role.
-
-Current metacommitters are:
-
-    Allison Randal
-X<Randal, Allison>
-    Chip Salzenberg
-X<Salzenberg, Chip>
-    Jerry Gay
-X<Gay, Jerry>
-    Will Coleda
-X<Coleda, Will>
-    Jesse Vincent
-X<Vincent, Jesse>
+Parrot repository. Once a contributor is selected commit access, a
+Metacommitter performs the necessary magic to give the new committer
+access to the SVN repository and the bugtracker. The Architect is a
+Metacommitter, but other Project Team members may also hold this role.
 
-The procedure on how to manage the list of Parrot committers can be
-found in F<docs/project/metacommiter_guide.pod>.
-
-=back
-
-=head2 Committers
+=item Committer
 
 X<Committers>
 Contributors who submit numerous, high-quality patches may be
@@ -170,8 +90,6 @@
 considered for commit access either by being nominated by another
 Committer, or by requesting it.
 
-=over 4
-
 =item Core Developer
 
 Core Developers develop and maintain core subsystems such as the IO subsystem,
@@ -182,24 +100,22 @@
 Compiler Developers develop and maintain one or more Parrot front-end
 compilers such as IMCC, PIRC, PGE and TGE.
 
-=item High Level Language Developer
+=item High-Level Language Developer
 
 Developers who work on any of the high-level languages that target
 Parrot such as TCL, Lua or Perl 6, are High-Level Language Developers.
-Many of these language projects are located in the Parrot repository,
-although some are maintained in separate locations. It is the intention
-that all languages be developed separately from Parrot before the 1.0
-release.
+Some of these language projects are located in the Parrot repository,
+although most are maintained in separate locations.
 
 =item Build Manager
 
 Build Managers maintain and extend configuration and build subsystems.
 They review smoke reports and attempt to extend platform support.
 
-=item Lead Tester
+=item Tester
 
 Developing, maintaining, and extending test suite coverage and testing
-tool are the key tasks for the Lead Testers. Lead Testers are also
+tool are the key tasks for the Testers. Testers are also
 responsible for testing goals, including complete coverage of core
 components on targeted platforms.
 
@@ -211,16 +127,6 @@
 patches for conformance with coding standards and desirability of
 features.
 
-=back
-
-A list of committers that have a role they've taken responsibility for
-can be found in F<RESPONSIBLE_PARTIES>.
-
-=head2 Contributors
-X<Contributors>
-
-=over 4
-
 =item Cage Cleaners
 
 Parrot's cage, the development working environment, has a tendency to
@@ -228,156 +134,76 @@
 aptly-named Cage Cleaners to ensure that coding standards are followed, that
 documentation is complete and accurate, that all tests are functioning
 properly, and that there are plenty of coding examples for new users to
-learn from. A class of tickets in the RT tracking system has been created
-especially for use by this group. This position encompasses tasks that
-run the gamut from entry-level to advanced, and is a good entry point
-for new users who want to get more familiar with Parrot internals.
+learn from. A class of tickets in the issue tracking system has been
+created especially for use by this group. This position encompasses
+tasks that run the gamut from entry-level to advanced, and is a good
+entry point for new users who want to get more familiar with Parrot
+internals.
 
 =item General Contributor
 
 Contributors are volunteers who write code or documentation patches,
 take part in email or online conversations, or contribute to the project
-in other important ways. All volunteer contributions are appreciated
-and recognized, with their names being added to the F<CREDITS> file in
-the Parrot repository. When a new contributor submits patches which have
-been accepted, they should add their name to this list.
+in other important ways. All volunteer contributions are appreciated.
 
 =back
 
-The list of general contributors can be found in F<CREDITS>.
-
-=head2 Furthermore
+=head2 Development Cycles
 
-X<Hansen, Ask BjE<oslash>rn>
-X<Spier, Robert>
-Last, but not least, is the glue that holds the project together.
-BjE<oslash>rn Hansen and Robert Spier manage the email, revision
-control, and bug-tracking systems, as well as the web sites for Parrot,
-U<http://www.parrotcode.org> and now U<http://www.parrot.org>. Without
-these systems, the project would grind to a screeching halt.
-
-In the end, it is the developers themselves who hold the project
-together. Individuals bear their own share of responsibility for
-finding tasks that suit their skills, coordinating with others to keep
-duplicated effort minimal, and ensuring that the job gets done.
-
-=head2 Where to go
-
-X<Parrot;mailing lists>
-Mailing lists are an important tool for communication, and the Parrot
-Development team maintains a special-purpose mailing list to coordinate
-the efforts of the many team members. The mailing list for Parrot is
-called "parrot-dev", and you can subscribe to it by sending a blank
-email message to  U<parrot-dev-subscribe at parrot.org>. The list is
-archived at U<http://dir.gmane.org/gmane.comp.compilers.parrot.devel>
-and available via NNTP at
+X<development cycles;Parrot>
+The Parrot development cycle centers on monthly releases. Most monthly releases
+are development releases, and two releases a year are production releases. The
+production releases are numbered X.0 and X.5, while the development releases
+take a major or minor version number between each production release.
+
+Development proceeds at a steady pace with bugs reported, patches
+submitted, patches applied, and all sorts of other regular development
+tasks performed. The pace isn't so much a result of careful planning as
+it is the law of averages; on any given day someone, somewhere, is
+working on Parrot. In periods of high activity there are often many more
+people working on Parrot N<Or related tools, or high-level language
+compilers, etc.> then just one. 
+
+Activity tends to spike when a release is approaching to close tickets, fix
+bugs, clean up documentation, and prepare the supporting files for the release.
+Immediately after the release, there is generally a flurry of branch merges,
+feature additions, or removal of deprecated features, since the week after the
+release allows the maximum time for testing before the next release. Releases
+also encourage feedback as casual users and testers get their hands on the
+newest version. These regular swells of activity are one of the major
+motivations for monthly releases.
+
+=head2 Getting Involved
+
+X<p2 (Parrot mailing list)>
+The first step to getting involved in the Parrot project, whether you
+want to hack code, write documentation, or help in other ways, is to
+join the mailing list. The topics on the list tend to
+revolve around practical matters: bug reports, notifications of
+changes committed to the subversion repository, questions on coding
+style, and how to implement particular features.
+
+The primary mailing list for Parrot is called "parrot-dev", and you can
+subscribe to it or view the archives through the web interface at
+U<http://lists.parrot.org/XXX>. The archives are also available on
+Google Groups at U<http://groups.google.com/group/parrot-dev> and via NNTP at
 U<nntp://news.gmane.org/gmane.comp.compilers.parrot.devel>.
-This list was previously called "parrot-porters", and even earlier
-"perl6-internals". If you want to access posts from earlier in Parrot's
-history, search for internet archives of those lists.
-
-You can also read the parrot-dev list via Google Groups at
-U<http://groups.google.com/group/parrot-dev>
 
 X<Parrot;sites>
 Parrot information and documentation can be accessed on the web in a
-variety of locations. The following web sites should have all the
-Parrot information you need to get started:
-
-=over 4
-
-=item * U<http://www.parrot.org>
-
-=item * U<http://dev.perl.org/perl6>
-
-=item * U<http://bugs6.perl.org>
-
-=item * U<http://pugscode.org>
-
-=back
+variety of locations. The main website is U<http://www.parrot.org>,
+where you'll find recent news, and information about the project and
+foundation. The heart of development is U<http://trac.parrot.org>,
+Parrot's ticket submission and tracker, wiki, source code browser, and
+project roadmap.
+
+Parrot developers, volunteers, and well-wishers also congregate on IRC
+at C<#parrot> on the U<irc://irc.perl.org> server. It's a good place to
+get real-time answers to questions, or just to see how things are
+progressing.
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/book/ch02_getting_started.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch02_getting_started.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch02_getting_started.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,191 +1,54 @@
 =pod
 
-=head1 Project Development
-
-Z<CHP-2>
-
-The Parrot project is specially organized to be light-weight and
-efficient. The project is governed like a meritocracy; people who
-make valuable contributions are offered more responsibility. Communication
-is relaxed and informal, often intermittent through email and on IRC. As
-Dan is so fond of saying, "This is far too important to take seriously."
-The Parrot developers act a bit like a special forces unit where the
-objective is pursued because the whole team knows the task at hand, not
-because of any tight control from above.
-
-=head2 Development Cycles
-
-Z<CHP-2-SECT-2.1>
-
-X<development cycles;Parrot>
-The Parrot development cycle centers on regular "point releases." A point
-release corresponds to a version change, such as 0.4.x to 0.5.x. These
-releases typically happen monthly, which is good because nobody has
-to guess when the next one will be. The architect and release managers
-decide whether the release is a "major" or minor one, depending on the
-changes that have been made and the features that have been added in the
-previous month. Usually one or two solid new features trigger a major
-point release. The Parrot team has specified a general roadmap of major
-point releases, and the expected features and changes that will trigger
-each one.
-
-Development proceeds at a steady pace with bugs reported, patches
-submitted, patches applied, and all sorts of other regular development
-tasks performed. The pace isn't so much a result of careful planning as
-it is the law of averages; on any given day someone, somewhere, is
-working on Parrot. In periods of high activity there are often many more
-people working on Parrot N<Or related tools, or high-level language
-compilers, etc.> then just one. Activity tends to spike when a release
-is approaching as last minute bugs, especially bugs in the build system
-or bugs that cause segmentation faults, are found and fixed by the team.
-After the release, there is an influx of new bug reports and other
-feedback as the casual users and testers get their hands on the newest
-version. These regular swells of activity are one of the major reasons
-why Parrot has monthly releases.
-
-=head2 Getting Involved
-
-Z<CHP-2-SECT-2.2>
-
-X<p2 (Parrot mailing list)>
-X<Parrot;getting involved>
-The first step to getting involved in the Parrot project, whether you
-want to hack code, write documentation, or help in other ways, is to
-join the Parrot-porters (p2) mailing list. The topics on p2 tend to
-revolve around practical matters: bug reports, patches, notifications
-of changes committed to the subversion repository, and questions on
-coding style. Occasionally there are discussions about how to implement
-particular features, although such discussions are often better-suited
-for other communications media, such as IRC.
-
-The Parrot developers, along with other volunteers and well-wishers
-tend to congregate on IRC to have more in-depth discussions. They
-maintain a chatroom C<#parrot> on the U<irc://irc.perl.org> server.
-To get real-time answers to questions, or just to see how things are
-progressing, the chatroom is the place to be.
-
-=head3 Use the source
-
-Z<CHP-2-SECT-2.2.1>
-
-X<Parrot;source code>
-The second step to participating in Parrot development is to get a
-copy of the source code. If you just want to try it out--experiment
-with a few features and see how it feels--the best options is to
-download the most recent point release for your system. Point releases
-are usually packaged up for easy download and install for various
-platforms, including Windows, Debian, and Redhat. Point releases are
-also available from CPAN. The sure way to get the most recent release is at
-U<http://search.cpan.org/dist/parrot/> (or search for "parrot" in
-"Distributions"). If you want something a little more cutting edge than
-the packaged release, a new snapshot of the subversion repository is
-created every eight hours. The most recent snapshot is always available
-at U<http://cvs.perl.org/snapshots/parrot/parrot-latest.tar.gz>.
-
-If you plan to get involved in development, you'll want to check out
-the source from the subversion repository directly. Anyone can get
-anonymous access to read the files and download a working copy to
-explore and test. For commit access, volunteers need a
-U<http://auth.perl.org> username, and need to be approved by a
-Metacommiter. To download the most recent version from SVN, type this
-command into your terminal N<This is for Linux users, on Mac or
-Windows systems, follow the instructions from your SVN client>:
-
-  svn co https://svn.parrot.org/parrot/trunk parrot
-
-There's also a web interface for viewing files in the repository at
-U<http://svn.parrot.org/parrot/>. 
-
-The repository is large and complex, so it's worth taking a little bit
-of time to explore. The code changes constantly, but most files and
-functions have informative descriptions to help keep track of things.
-
-The most important top-level directory is F<docs/>.  The content isn't
-always up to date, but it is a good place to start. F<parrot.pod>
-provides a quick overview of what's in each documentation file. If you're
-a capable writer and know a thing or two about how Parrot works, the
-documentation is a great place to start contributing. This book that
-you're reading right now was created in F<docs/book/> by ordinary
-contributors. Most other documentation files found here are parsed and
-converted to HTML for display at U<http://www.parrot.org>.
-
-The F<languages/> directory contains the code that implements various
-language compilers N<This isn't entirely true. As of the 1.0 release
-of Parrot, all HLLs are supposed to reside elsewhere, not in the
-Parrot repository. If the languages disappear from there, we'll
-probably be nice enough to leave a note telling you where it went>:
-Perl 6, Python ("Pynie"), Ruby ("Cardinal"), PHP ("Pipp"), Lisp, Lua,
-Tcl ("partcl"), WMLScript, Forth, Scheme, Befunge, BASIC, and many
-others. These language compilers are in various stages of partial
-completion. The page L<https://trac.parrot.org/parrot/wiki/Languages>
-provides meta information on
-the included languages and on the many language projects that are
-being developed and maintained outside the Parrot repository. If you
-have a language you're particularly interested to see implemented on
-Parrot, you can see how far along the effort is, or you can start the
-work to implement it yourself. We'll talk more about creating new
-compilers in Chapter 10: High-Level Languages, if you're interested.
-
-The F<lib/> directory contains Perl 5 classes currently used in
-developing, building, and testing Parrot. The F<src/pmc/> directory
-contains the C source code for Parrot classes (PMCs, which you'll read
-more about in A<CHP-11>Chapter 11).
-
-Most Parrot development happens in F<src/> for the C source code, and
-F<include/parrot/> for the C development header files.
-
-Libraries for use by programs running on Parrot are found in F<runtime/>.
-
-The F<examples/> directory contains some example Parrot PIR and Assembly
-code, as well as benchmarks. More discussions about these topics will be
-found in A<CHP-3> Chapter 3, A<CHP-5> Chapter 5, and A<CHP-7> Chapter 7
-respectively.
+=head1 Getting Started
 
 =head1 Building Parrot
 
 Z<CHP-2-SECT-2.2.2>
 
 X<Parrot;source code>
-The first step before you start playing with Parrot's PASM and PIR
-code is to get a copy of the source code and compile it. PASM is
-the Parrot assembly language and is introduced in A<CHP-5>Chapter 5.
-PIR, an intermediate-level language that is used most often in compiler
-development, is discussed in A<CHP-3>Chapter 3.
-
-The basic steps involved in building Parrot from the source code from
-the command line are: N<Not all operating systems have F<make>. Check
-the documentation for instructions for systems that aren't Unix-based.>
+The first step before you start playing with Parrot is to get a copy of
+the source code and compile it. You can download the latest monthly
+release from U<http://www.parrot.org/release/current>.
+
+To build Parrot you'll need a C compiler and a make utility. Generally,
+you'll use F<gcc> and F<make>, but many different versions of these
+tools are supported on different operation systems. Perl is also needed
+for parts of the configuration and build process. The following
+command-line instructions will build the core virtual machine and
+compiler toolkit, and run the standard test suite.
 
   $ perl Configure.pl
   $ make
   $ make test
 
-X<PASM (Parrot assembly language);compiling>
-Once you've compiled Parrot, create a small test file in the main
-F<parrot> directory.  We'll call it F<fjord.pasm>.
+Once you've compiled Parrot, you can run your first small script. Create
+a test file in the main F<parrot> directory called
+F<fjord.pasm> (F<.pasm> files are Parrot assembly language).
 
   print "He's pining for the fjords.\n"
   end
 
-X<.pasm files>
-I<.pasm> is the standard extension for Parrot assembly language source
-files. Now you can run this file with:
+Now run this file with:
 
   $ ./parrot fjord.pasm
 
-And watch the result of the program execution. Instead of executing
-the program immediately, you could also compile it to bytecode:
+which will print:
+
+  He's pining for the fjords.
+
+Next, try out one of Parrot's high-level languages. Create a test file
+called F<hello.nqp>:
+
+  say "Hello, World!"
 
-  $ ./parrot --output fjord.pbc fjord.pasm
+Then run it as:
 
-You specify the name of the output bytecode file with the C<--output>
-(or C<-o>) switch.  I<.pbc> is the standard extension for Parrot
-bytecode. To execute the compiled bytecode, run it through the
-F<parrot> interpreter:
+  $ ./nqp hello.nqp
 
-  $ ./parrot fjord.pbc
+With a few simple examples, you have 
 
-This is, of course, a simple and contrived example. In the next few
+In the next few
 chapters we will discuss more aspects of Parrot programming using
 both PASM and PIR, and we will discuss some of the more advanced
 features of Parrot that make it an interesting and attractive
@@ -218,44 +81,31 @@
 
 Subversion is the source control system that is used by the Parrot project.
 You need subversion to checkout the latest version of the source code. You can
-get subversion at L<http://subversion.tigris.org>, or on Linux systems you
-can use the command
-
-  sudo apt-get install subversion
+get subversion at L<http://subversion.tigris.org>, or through one of the
+common packaging systems.
 
 =item* bison and flex
 
 Bison and Flex are used to create the lexical analyzer and parser components
 for the PIR compilers IMCC and PIRC. These are not necessary most of the time
-unless you are planning to hack on IMCC and PIRC directly. On Linux systems you
-can use the command
-
-  sudo apt-get install bison flex
+unless you are planning to hack on IMCC and PIRC directly.
 
 =item* ICU
 
 ICU is a library for handling and manipulating Unicode text strings. Without
 ICU libraries installed, you wont be able to use Unicode with your built
-Parrot. On Linux systems you can get ICU with this command:
-
-  sudo apt-get install libicu-dev
+Parrot.
 
 =item* GMP
 
-GMP is a mathematics library for manipulating arbitrary precision and arbitrary
-size numbers. GMP is used by the BigInt and BigNum PMCs, so without GMP you
-won't have access to these data types. To get GMP on Linux systems, use the
-command:
-
-  sudo apt-get install libgmp3-dev
+GMP is a mathematics library for manipulating arbitrary precision and
+arbitrary size numbers. GMP is an optional library used by the BigInt
+and BigNum PMCs.
 
 =item* Readline
 
 The readline library allows some advanced behaviors on the command line such
-as command history. You can get the readline library on Linux by using the
-command:
-
-  sudo apt-get install libreadline5-dev
+as command history.
 
 =item* PCRE
 
@@ -289,237 +139,83 @@
   sudo cpan File::HomeDir File::Which Readonly Regexp::Parser
   sudo cpan Perl::Critic Perl::Critic::Bangs Test::Perl::Critic
 
-=head2 Patch submission
 
-Z<CHP-2-SECT-2.2.3>
+=head3 Use the source
 
-X<Parrot;patch submission>
-Parrot development proceeds through a continuous stream of patches.
-Patches are the currency of exchange in the project--the unit of
-work. Patches can fix bugs, add features, modify capabilities,
-remove cruft, and improve the suite of tests and the project
-documentation. If something needs to change, it will typically require
-the submission of a new patch.
-
-While anyone is free to submit a patch, only a small number of people have
-the ability to apply patches to the central Parrot repository.
-These people are called I<committers>. By allowing all people to get
-involved through patch submission and testing, the project can harness
-the efforts of a large group but still keep the same high quality
-as a small group of experienced developers.
-
-Every submitted patch is automatically forwarded to the p2 list where
-it's subject to peer review. Small patches typically spark little debate,
-and can be well-tested on many platforms before being committed to the
-repository. Patches tend to be small modular changes, which makes for
-easy testing and evaluation. Occasionally a large feature such as an entire
-language implementation is submitted in a single patch, but these are the
-exceptions.
-
-Submitting a patch is fairly straightforward. You create a file that
-lists all your changes, a diff or a patch, and email it to the ticket
-tracking system at U<parrotbug at parrotcode.org>. It's important to make
-sure your patch and your email have descriptive titles so that the
-committers and testers have a better idea about what it does. The body of
-your email should also include a good description about what you changed
-and why.
-
-It's important that you create your patches from a checked-out subversion
-repository, not from a tarball or a snapshot. This way, you can ensure
-that your diff is made against the latest version of the files. If you patch
-an old version, the problem may have already been resolved! Make sure
-the paths listed in the patch match those in the repository. There are two
-methods of creating patches that will do this for you. You can make changes
-directly in your checked-out copy of the subversion repository and
-then create diffs using the command C<svn diff>. Alternatively, you can
-make a copy of the repository and then create diffs between the two
-copies with the C<diff -u> command:
-
-  diff -u parrot/README parrot_changed/README
-
-Either method is fine, and both are equally common on p2. Your
-working style and the types of changes you make--small and modular
-versus large and sweeping--will influence which method you choose.
-
-Next, when you're making changes, take some extra time to consider how
-your patch affects the rest of the system. If your patch adds a new
-file, patch the main F<MANIFEST> file to include it. If you add a new
-feature, make sure to write tests for it. If you fix a bug, add a test
-to prove that it's fixed. See A<CHP-9-SECT-13>"Writing Tests" in Chapter
-9 for more on writing tests for Parrot. Tests are very important for
-Parrot development, and writing good tests is a valuable skill for
-developers to have. Before you submit a patch always recompile the
-system yourself with the patch included and run all tests to prove that
-it works. You can build and test Parrot completely by running the
-following commands:
-
-  make clean
-  perl Configure.pl
-  make
-  make test
-
-Consider the people who will review and apply your patch, and try
-to make their jobs easier. Patch filenames should be as descriptive as
-possible: F<fix_readme_aardvark_typo.patch> is far better than
-F<README.patch>. An attached file is better than a diff pasted into an
-email, because it can be applied without manual editing. The
-conventional extension for patch files is F<.patch>.
-
-In the email message, always start the subject with "[PATCH]", and
-make the subject as clear as possible: "[PATCH] misspelled aardvark in
-main README file" is better than "[PATCH] typo". The body of the
-message should clearly explain what the patch is supposed to do and
-why you're submitting it. Make a note if you're adding or deleting
-files so they won't be missed.
-
-Here is a good example of a patch submission using the subversion diff
-method (an actual patch from p2). It's short, sticks to the point, and
-clearly expresses the problem and the solution. The patch filename and
-the subject of the message are both descriptive:
-
-=for author
-
-Possible alternates: ticket #23501, #24053 (not from top level)
-
-=end for
-
-  Subject: [PATCH] Pointers in List_chunk not initialized
-  From: Bruce Gray
-  
-  On Win32, these tests are segfaulting due to invalid
-  pointers in List_chunk structs:
-  t/op/string.t             97-98
-  t/pmc/intlist.t           3-4
-  t/pmc/pmc.t               80
-  
-  The problem is caused by list.c/allocate_chunk not
-  initializing the pointers. This patch corrects the problem.
-  
-  --
-  Hope this helps,
-  Bruce Gray
-
-With the attached file F<list_chunk_initialize.patch>:
-
-
-  Index: list.c
-  =========================================
-  RCS file: /cvs/public/parrot/list.c,v
-  retrieving revision 1.23
-  diff -u -r1.23 list.c
-  --- list.c        27 Dec 2002 09:33:11 -0000        1.23
-  +++ list.c        28 Dec 2002 03:37:35 -0000
-  @@ -187,6 +187,10 @@
-       Parrot_block_GC_sweep(interpreter);
-       chunk = (List_chunk *)new_bufferlike_header(interpreter, sizeof(*chunk));
-       chunk->items = items;
-  +    chunk->n_chunks = 0;
-  +    chunk->n_items  = 0;
-  +    chunk->next     = NULL;
-  +    chunk->prev     = NULL;
-       Parrot_allocate_zeroed(interpreter, (Buffer *)chunk, size);
-       Parrot_unblock_GC_mark(interpreter);
-       Parrot_unblock_GC_sweep(interpreter);
-
-=head3 Bug tracking
-
-Z<CHP-2-SECT-2.2.4>
-
-X<Parrot;bug tracking>
-Bug reports go to the same address as patch submissions
-(U<parrotbug at parrotcode.org>). Similar conventions apply: make the
-subject and the message as clear and descriptive as possible. The
-subject line should start with "[BUG]"  to make it immediately obvious
-what the message is about.
-
-X<Parrot;bug tracking>
-If you want to track a bug or patch you've submitted, the current
-queue of bugs and patches is publicly viewable at
-U<http://rt.perl.org>. Bug tracking for Parrot is handled by the
-Request Tracker (RT) ticket tracking system from Best Practical
-Solutions.
+X<Parrot;source code>
+The second step to participating in Parrot development is to get a
+copy of the source code. If you just want to try it out--experiment
+with a few features and see how it feels--the best options is to
+download the most recent point release for your system. Point releases
+are usually packaged up for easy download and install for various
+platforms, including Windows, Debian, and Redhat. Point releases are
+also available from CPAN. The sure way to get the most recent release is at
+U<http://search.cpan.org/dist/parrot/> (or search for "parrot" in
+"Distributions"). If you want something a little more cutting edge than
+the packaged release, a new snapshot of the subversion repository is
+created every eight hours. The most recent snapshot is always available
+at U<http://cvs.perl.org/snapshots/parrot/parrot-latest.tar.gz>.
 
-=cut
+If you plan to get involved in development, you'll want to check out
+the source from the subversion repository directly. Anyone can get
+anonymous access to read the files and download a working copy to
+explore and test. For commit access, volunteers need a
+U<http://auth.perl.org> username, and need to be approved by a
+Metacommiter. To download the most recent version from SVN, type this
+command into your terminal N<This is for Linux users, on Mac or
+Windows systems, follow the instructions from your SVN client>:
+
+  svn co https://svn.parrot.org/parrot/trunk parrot
+
+There's also a web interface for viewing files in the repository at
+U<http://svn.parrot.org/parrot/>. 
+
+The repository is large and complex, so it's worth taking a little bit
+of time to explore. The code changes constantly, but most files and
+functions have informative descriptions to help keep track of things.
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#  
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
+The most important top-level directory is F<docs/>.  The content isn't
+always up to date, but it is a good place to start. F<parrot.pod>
+provides a quick overview of what's in each documentation file. If you're
+a capable writer and know a thing or two about how Parrot works, the
+documentation is a great place to start contributing. This book that
+you're reading right now was created in F<docs/book/> by ordinary
+contributors. Most other documentation files found here are parsed and
+converted to HTML for display at U<http://www.parrot.org>.
+
+The F<languages/> directory contains the code that implements various
+language compilers N<This isn't entirely true. As of the 1.0 release
+of Parrot, all HLLs are supposed to reside elsewhere, not in the
+Parrot repository. If the languages disappear from there, we'll
+probably be nice enough to leave a note telling you where it went>:
+Perl 6, Python ("Pynie"), Ruby ("Cardinal"), PHP ("Pipp"), Lisp, Lua,
+Tcl ("partcl"), WMLScript, Forth, Scheme, Befunge, BASIC, and many
+others. These language compilers are in various stages of partial
+completion. The page L<https://trac.parrot.org/parrot/wiki/Languages>
+provides meta information on
+the included languages and on the many language projects that are
+being developed and maintained outside the Parrot repository. If you
+have a language you're particularly interested to see implemented on
+Parrot, you can see how far along the effort is, or you can start the
+work to implement it yourself. We'll talk more about creating new
+compilers in Chapter 10: High-Level Languages, if you're interested.
+
+The F<lib/> directory contains Perl 5 classes currently used in
+developing, building, and testing Parrot. The F<src/pmc/> directory
+contains the C source code for Parrot classes (PMCs, which you'll read
+more about in A<CHP-11>Chapter 11).
+
+Most Parrot development happens in F<src/> for the C source code, and
+F<include/parrot/> for the C development header files.
+
+Libraries for use by programs running on Parrot are found in F<runtime/>.
+
+The F<examples/> directory contains some example Parrot PIR and Assembly
+code, as well as benchmarks. More discussions about these topics will be
+found in A<CHP-3> Chapter 3, A<CHP-5> Chapter 5, and A<CHP-7> Chapter 7
+respectively.
+
+=cut
 
 # Local variables:
 #   c-file-style: "parrot"

Modified: branches/vtable_morph_change/docs/book/ch03_pir_basics.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch03_pir_basics.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch03_pir_basics.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -521,13 +521,13 @@
   $S0 = $P0      # Stringify. "5"
   $N0 = $P0      # Numify. 5.0
   $I0 = $P0      # De-box. $I0 = 5
-  
+
   $P1 = new 'String'
   $P1 = "5 birds"
   $S1 = $P1      # De-box. $S1 = "5 birds"
   $I1 = $P1      # Intify. 5
   $N1 = $P1      # Numify. 5.0
-  
+
   $P2 = new 'Number'
   $P2 = 3.14
   $S2 = $P2      # Stringify. "3.14"
@@ -905,7 +905,7 @@
 
   $P0["severity"] = 1   # An integer value
   $P0["type"] = 2       # Also an Integer
-  
+
 Finally, there is a spot for additional data to be included:
 
   $P0["payload"] = $P2  # Any arbitrary PMC
@@ -948,7 +948,7 @@
   set_addr $P0, my_handler
   push_eh $P0
   ...
-  
+
   my_handler:
     ...
 
@@ -1011,86 +1011,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/book/ch04_pir_subroutines.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch04_pir_subroutines.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch04_pir_subroutines.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -308,7 +308,7 @@
 
   $I0 = $P0.'arity'()
 
-To get the namespace PMC that the Sub was defined int, you can call the
+To get the namespace PMC that the Sub was defined into, you can call the
 C<get_namespace> method:
 
   $P1 = $P0.'get_namespace'()
@@ -348,22 +348,21 @@
 a X<tailcall> tailcall, and is an important opportunity for optimization.
 Here's a contrived example in pseudocode:
 
- call add_two(5)
+  call add_two(5)
 
- subroutine add_two(value)
-	 value = add_one(value)
-	 return add_one(value)
-
-In this example, the subroutine C<add_two> makes two calls to
-c<add_one>. The second call to C<add_one> is used as the return
-value. C<add_one> is called and its result is immediately returned
-to the caller of C<add_two>, it is never stored in a local register or
-variable in C<add_two>, it's immediately returned. We can
-optimize this situation if we realize that the second call to
+  subroutine add_two(value)
+    value = add_one(value)
+    return add_one(value)
+
+In this example, the subroutine C<add_two> makes two calls to c<add_one>. The
+second call to C<add_one> is used as the return value. C<add_one> is called
+and its result is immediately returned to the caller of C<add_two>, it is
+never stored in a local register or variable in C<add_two>, it's immediately
+returned. We can optimize this situation if we realize that the second call to
 C<add_one> is returning to the same place that C<add_two> is, and therefore
-can utilize the same return continuation as C<add_two> uses. The
-two subroutine calls can share a return continution, instead of
-having to create a new continuation for each call.
+can utilize the same return continuation as C<add_two> uses. The two
+subroutine calls can share a return continution, instead of having to create
+a new continuation for each call.
 
 X<.tailcall directive>
 In PIR code, we use the C<.tailcall> directive to make a tailcall like this,
@@ -376,14 +375,14 @@
       value = add_two(5)
       say value
   .end
-  
+
   .sub add_two
       .param int value
       .local int val2
       val2 = add_one(value
       .tailcall add_one(val2)
   .end
-  
+
   .sub add_one
       .param int a
       .local int b
@@ -392,32 +391,32 @@
   .end
 
 This example above will print out the correct value "7".
-      
+
 =head3 Creating and Using Continuations
 
-Most often continuations are used implicitly in the other control-flow
+Most often continuations are used implicitly by the other control-flow
 operations in Parrot. However, they can also be created and used explicitly
 when required. Continuations are like any other PMC, and can be created
 using the C<new> keyword:
 
   $P0 = new 'Continuation'
-  
+
 The new continuation starts off in an undefined state. Attempting to invoke
 a new continuation after it's first been created will raise an exception. To
 prepare the continuation for use, a destination label must be assigned to it
 with the C<set_addr> opcode:
 
-  $P0 = new 'Continuation'
-  set_addr $P0, my_label
- 
- my_label:
-  ...
+    $P0 = new 'Continuation'
+    set_addr $P0, my_label
+
+  my_label:
+    ...
 
 To jump to the continuation's stored label and return the context to the
 state it was in when the continuation was created, use the C<invoke> opcode
 or the C<()> notaton:
 
-  invoke $P0  # Explicit using PASM-like opcodes
+  invoke $P0  # Explicit using "invoke" opcode
   $P0()       # Same, but nicer syntax
 
 Notice that even though you can use the subroutine notation C<$P0()> to
@@ -428,7 +427,7 @@
   set_addr $P0, my_label
 
   $P0(1, 2)      # WRONG!
-  
+
   $P1 = $P0()    # WRONG!
 
 =head2 Lexical Subroutines
@@ -437,8 +436,8 @@
 As we've mentioned above, Parrot offers support for lexical subroutines.
 What this means is that we can define a subroutine by name inside a
 larger subroutine, and our "inner" subroutine is only visible and callable
-from the "outer" subroutine. Plus, the "inner" subroutine inherits all the
-lexical variables from the outer subroutine, but is able to define its
+from the "outer" outer. The "inner" subroutine inherits all the lexical
+variables from the outer subroutine, but is able to define its
 own lexical variables that cannot be seen or modified by the outer subroutine.
 This is important because PIR doesn't have anything corresponding to blocks
 or nested scopes like some other languages have. Lexical subroutines play
@@ -448,7 +447,7 @@
 method on the Sub PMC:
 
   $P1 = $P0.'get_outer'()
-  
+
 If there is no C<:outer> PMC, this returns a NULL PMC. Conversely, you can
 set the outer sub:
 
@@ -500,8 +499,8 @@
 In PIR, there is only one structure that supports scoping like this: the
 subroutine N<and objects that inherit from subroutines, such as methods,
 coroutines, and multisubs, which we will discuss later>. There are no blocks
-in PIR that have their own scope, we have only subroutines. Fortunately,
-we can use lexical subroutines to simulate this behavior that HLLs require:
+in PIR that have their own scope besides subroutines. Fortunately, we can use
+these lexical subroutines to simulate this behavior that HLLs require:
 
   .sub 'MyOuter'
       .lex int x
@@ -512,9 +511,17 @@
 
   .sub 'MyInner' :outer('MyOuter')
       .lex int z
-      #x, y, and z are all visible here
+      #x, y, and z are all "visible" here
   .end
 
+In the example above we put the word C<"visible"> in quotes. This is because
+lexically-defined variables need to be accessed with the C<get_lex> and
+C<set_lex> opcodes. These two opcodes don't just access the value of a
+register, where the value is stored while it's being used, but they also make
+sure to interact with the C<LexPad> PMC that's storing the data. If the value
+isn't properly stored in the LexPad, then they won't be available in nested
+inner subroutines, or available from C<:outer> subroutines either.
+
 =head3 Lexical Variables
 
 As we have seen above, we can declare a new subroutine to be a nested inner
@@ -530,9 +537,10 @@
 =head3 LexPad and LexInfo PMCs
 
 Information about lexical variables in a subroutine is stored in two different
-types of PMCs: The LexPad and LexInfo PMCs. Neither of these PMC types are
-really usable from PIR code, but are instead used by Parrot internally to
-store information about lexical variables.
+types of PMCs: The LexPad PMC that we already mentioned breifly, and the
+LexInfo PMCs which we haven't. Neither of these PMC types are really usable
+from PIR code, but are instead used by Parrot internally to store information
+about lexical variables.
 
 C<LexInfo> PMCs are used to store information about lexical variables at
 compile time. This is read-only information that is generated during
@@ -587,11 +595,11 @@
 Here is a way to rewrite that algorithm using only a single subroutine instead:
 
   .sub main
-      $I1 = 5         # counter
-      call fact       # same as bsr fact
+      $I1 = 5           # counter
+      call fact         # same as "bsr fact"
       print $I0
       print "\n"
-      $I1 = 6         # counter
+      $I1 = 6           # counter
       call fact
       print $I0
       print "\n"
@@ -606,42 +614,19 @@
       ret
   .end
 
-The unit of code from the C<fact> label definition to C<ret> is a
-reusable routine. There are several problems with this simple
-approach. In terms of the interface, the caller has to know to pass the
-argument to C<fact> in C<$I1> and to get the result from C<$I0>. This is
-different from how subroutines are normally invoked in PIR.
-
-Another disadvantage of this approach is that C<main> and C<fact>
-share the same compilation unit, so they're parsed and processed as
-one piece of code. They share registers, and they would also share LexInfo
-and LexPad PMCs, if any were needed by C<main>. This is a problem when trying
-to follow normal encapsulation guidelines.
-
-=head3 PASM Subroutines
-
-Z<CHP-4-SECT-1.2>
-
-X<subroutines;PASM>
-X<PASM (Parrot assembly language);subroutines>
-PIR code can include pure PASM compilation units. These are wrapped in
-the C<.emit> and C<.eom> directives instead of C<.sub> and C<.end>.
-The C<.emit> directive doesn't take a name, it only acts as a
-container for the PASM code N<in terms of parser terminology, the C<.emit>
-directive causes the parser to transition into PASM mode. The C<.eom> directive
-causes the parser to transition back into PIR mode>. These primitive
-compilation units can be useful for grouping PASM functions or function
-wrappers. Subroutine entry labels inside C<.emit> blocks have to be global
-labels:
-
-  .emit
-  _substr:
-      ...
-      ret
-  _grep:
-      ...
-      ret
-  .eom
+The unit of code from the C<fact> label definition to C<ret> is a reusable
+routine, but is only usable from within the C<main> subroutine. There are
+several problems with this simple approach. In terms of the interface, the
+caller has to know to pass the argument to C<fact> in C<$I1> and to get the
+result from C<$I0>. This is different from how subroutines are normally
+invoked in PIR.
+
+Another disadvantage of this approach is that C<main> and C<fact> share the
+same compilation unit, so they're parsed and processed as one piece of code.
+They share registers. They would also share LexInfo and LexPad PMCs, if any
+were needed by C<main>. The C<fact> routine is also not easily usable from
+outside the c<main> subroutine, so other parts of your code won't have access
+to it. This is a problem when trying to follow normal encapsulation guidelines.
 
 =head2 Namespaces, Methods, and VTABLES
 
@@ -652,9 +637,30 @@
 X<classes;methods>
 X<. (dot);. (method call);instruction (PIR)>
 PIR provides syntax to simplify writing methods and method calls for
-object-oriented programming. These calls follow the Parrot
-calling conventions as well. First we want to discuss I<namespaces>
-in Parrot.
+object-oriented programming. We've seen some method calls in the examples
+above, especially when we were talking about the interfaces to certain PMC
+types. We've also seen a little bit of information about classes and objects
+in the previous chapter. PIR allows you to define your own classes, and with
+those classes you can define method interfaces to them. Method calls follow
+the same Parrot calling conventions that we have seen above, including all the
+various parameter configurations, lexical scoping, and other aspects we have
+already talked about.
+
+Classes can be defined in two ways: in C and compiled to machine code, and
+in PIR. The former is how the built-in PMC types are defined, like
+C<ResizablePMCArray>, or C<Integer>. These PMC types are either built with
+Parrot at compile time, or are compiled into a shared library called a
+I<dynpmc> and loaded into Parrot at runtime. We will talk about writing PMCs
+in C, and dealing with dynpmcs in chapter 11.
+
+The second type of class can be defined in PIR at runtime. We saw some
+examples of this in the last chapter using the C<newclass> and C<subclass>
+opcodes. We also talked about class attribute values. Now, we're going to talk
+about associating subroutines with these classes, and they're called
+I<methods>. Methods are just like other normal subroutines with two major
+changes: they are marked with the C<:method> flag, and they exist in a
+I<namespace>. Before we can talk about methods, we need to discuss
+namespaces first.
 
 =head3 Namespaces
 
@@ -665,11 +671,11 @@
 Namespaces provide a mechanism where names can be reused. This may not
 sound like much, but in large complicated systems, or systems with
 many included libraries, it can be very handy. Each namespace get's its
-own area for function names and global variables. This way, you can have
+own area for function names and global variables. This way you can have
 multiple functions named C<create> or C<new> or C<convert>, for
-instance, without having to use I<Multi-Method Dispatch> (MMD), which we
-will describe later. Namespaces are also important for defining classes,
-which we will also talk about a little later.
+instance, without having to use I<Multi-Method Dispatch> (MMD) which we
+will describe later. Namespaces are also vital for defining classes and their
+methods, which we already mentioned. We'll talk about all those uses here.
 
 Namespaces are specified with the C<.namespace []> directive. The brackets
 are not optional, but the keys inside them are. Here are some examples:
@@ -693,21 +699,47 @@
   $P0 = get_namespace ["Foo"]     # get PMC for namespace "Foo"
 
 Namespaces are arranged into a large n-ary tree. There is the root namespace
-at the top of the tree. In the root namespace are various special HLL
+at the top of the tree, and in the root namespace are various special HLL
 namespaces. Each HLL compiler gets its own HLL namespace where it can store
-its compiled data. Each HLL namespace may have a large hierarchy of other
-namespaces. The C<.namespace> directive that we've seen sets the current
-namespace. In PIR code, we have multiple ways to address a namespace:
+its data during compilation and runtime. Each HLL namespace may have a large
+hierarchy of other namespaces. We'll talk more about HLL namespaces and their
+significance in chapter 10.
+
+The root namespace is a busy place. Everybody could be lazy and use it to store
+all their subroutines and global variables, and then we would run into all
+sorts of collisions. One library would define a function "Foo", and then
+another library could try to create another subroutine with the same name.
+This is called I<namespace pollution>, because everybody is trying to put
+things into the root namespace, and those things are all unrelated to each
+other. Best practices requires that namespaces be used to hold private
+information away from public information, and to keep like things together.
+
+As an example, the namespace C<Integers> could be used to store subroutines
+that deal with integers. The namespace C<images> could be used to store
+subroutines that deal with creating and manipulating images. That way, when
+we have a subroutine that adds two numbers together, and a subroutine that
+performs additive image composition, we can name them both C<add> without any
+conflict or confusion. And within the C<image> namespace we could have sub
+namespaces for C<jpeg> and C<MRI> and C<schematics>, and each of these could
+have a C<add> method without getting into each other's way.
+
+The short version is this: use namespaces. There aren't any penalties to them,
+and they do a lot of work to keep things organized and separated.
+
+=head3 Namespace PMC
+
+The C<.namespace> directive that we've seen sets the current namespace. In
+PIR code, we have multiple ways to address a namespace:
 
   # Get namespace "a/b/c" starting at the root namespace
   $P0 = get_root_namespace ["a" ; "b" ; "c"]
-  
+
   # Get namespace "a/b/c" starting in the current HLL namespace.
   $P0 = get_hll_namespace ["a" ; "b" ; "c"]
   # Same
   $P0 = get_root_namespace ["hll" ; "a" ; "b" ; "c"]
 
-  # GEt namespace "a/b/c" starting in the current namespace
+  # Get namespace "a/b/c" starting in the current namespace
   $P0 = get_namespace ["a" ; "b" ; "c"]
 
 Once we have a namespace PMC we can retrieve global variables and
@@ -717,7 +749,7 @@
   $P1 = get_global ["Foo"], $S0   # Get global in namespace "Foo"
   $P1 = get_global $P0, $S0       # Get global in $P0 namespace PMC
 
-=head3 Namespace PMCs
+=head3 Operations on the Namespace PMC
 
 We've seen above how to find a Namespace PMC. Once you have it, there are a
 few things you can do with it. You can find methods and variables that are
@@ -726,23 +758,23 @@
   $P0 = get_namespace
   $P0.'add_namespace'($P1)      # Add Namespace $P1 to $P0
   $P1 = $P0.'find_namespace'("MyOtherNamespace")
-  
+
   # Find namespace "MyNamespace" in $P0, create it if it
   #    doesn't exist
   $P1 = $P0.'make_namespace'("MyNamespace")
 
   $P0.'add_sub'("MySub", $P2)   # Add Sub PMC $P2 to the namespace
   $P1 = $P0.'find_sub'("MySub") # Find it
-  
+
   $P0.'add_var'("MyVar", $P3)   # Add variable "MyVar" in $P3
   $P1 = $P0.'find_var'("MyVar") # Find it
-  
+
   # Return the name of Namespace $P0 as a ResizableStringArray
   $P3 = $P0.'get_name'()
-  
+
   # Find the parent namespace that contains this one:
   $P5 = $P0.'get_parent'()
-  
+
   # Get the Class PMC associated with this namespace:
   $P6 = $P0.'get_class'()
 
@@ -797,7 +829,7 @@
     $S0 = self                    # Already defined as "self"
     say $S0
   .end
-  
+
   .sub "MyMethod2" :method
     .param pmc item :invocant     # "self" is now called "item"
     $S0 = item
@@ -979,6 +1011,60 @@
 
 =back
 
+Here is a quick example of a simple coroutine:
+
+  .sub MyCoro
+    .yield(1)
+    .yield(2)
+    .yield(3)
+    .return(4)
+  .end
+
+  .sub main :main
+    $I0 = MyCoro()    # 1
+    $I0 = MyCoro()    # 2
+    $I0 = MyCoro()    # 3
+    $I0 = MyCoro()    # 4
+    $I0 = MyCoro()    # 1
+    $I0 = MyCoro()    # 2
+    $I0 = MyCoro()    # 3
+    $I0 = MyCoro()    # 4
+    $I0 = MyCoro()    # 1
+    $I0 = MyCoro()    # 2
+    $I0 = MyCoro()    # 3
+    $I0 = MyCoro()    # 4
+  .end
+
+This is obviously a contrived example, but it demonstrates how the coroutine
+stores it's state. The coroutine stores it's state when we reach a C<.yield>
+directive, and when the coroutine is called again it picks up where it last
+left off. Coroutines also handle parameters in a way that might not be
+intuitive. Here's an example of this:
+
+  .sub StoredConstant
+    .param int x
+    .yield(x)
+    .yield(x)
+    .yield(x)
+  .end
+
+  .sub main :main
+    $I0 = StoredConstant(5)       # $I0 = 5
+    $I0 = StoredConstant(6)       # $I0 = 5
+    $I0 = StoredConstant(7)       # $I0 = 5
+    $I0 = StoredConstant(8)       # $I0 = 8
+  .end
+
+Notice how even though we are calling the C<StoredConstant> coroutine with
+different arguments each time, the value of parameter C<x> doesn't change
+until the coroutine's state resets after the last C<.yield>. Remember that
+a continuation takes a snapshot of the current state, and the C<.yield>
+directive takes a continuation. The next time we call the coroutine, it
+invokes the continuation internally, and returns us to the exact same place in
+the exact same condition as we were when we called the C<.yield>. In order
+to reset the coroutine and enable it to take a new parameter, we must either
+execute a C<.return> directive or reach the end of the coroutine.
+
 =head2 Multiple Dispatch
 
 Multiple dispatch is when there are multiple subroutines in a single
@@ -1011,87 +1097,65 @@
 multiple functions in a single namespace need to have the same name that
 a multi is used.
 
-=cut
+Multisubs take a special designator called a I<multi signature>. The multi
+signature tells Parrot what particular combination of input parameters the
+multi accepts. Each multi will have a different signature, and Parrot will
+be able to dispatch to each one depending on the arguments passed. The
+multi signature is specified in the C<:multi> directive:
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
+  .sub 'Add' :multi(I, I)
+    .param int x
+    .param int y
+    .return(x + y)
+  .end
+
+  .sub 'Add' :multi(N, N)
+    .param num x
+    .param num y
+    .return(x + y)
+  .end
+
+  .sub Start :main
+    $I0 = Add(1, 2)      # 3
+    $N0 = Add(3.14, 2.0) # 5.14
+    $S0 = Add("a", "b")  # ERROR! No (S, S) variant!
+  .end
+
+Multis can take I, N, S, and P types, but they can also use C<_> (underscore)
+to denote a wildcard, and a string that can be the name of a particular PMC
+type:
+
+  .sub 'Add' :multi(I, I)  # Two integers
+    ...
+
+  .sub 'Add' :multi(I, 'Float')  # An integer and Float PMC
+    ...
+
+                           # Two Integer PMCs
+  .sub 'Add' :multi('Integer', _)
+    ...
+
+When we call a multi PMC, Parrot will try to take the most specific
+best-match variant, and will fall back to more general variants if a perfect
+best-match cannot be found. So if we call C<'Add'(1, 2)>, Parrot will dispatch
+to the C<(I, I)> variant. If we call C<'Add'(1, "hi")>, Parrot will match the
+C<(I, _)> variant, since the string in the second argument doesn't match C<I>
+or C<'Float'>. Parrot can also choose to automatically promote one of the I,
+N, or S values to an Integer, Float, or String PMC.
+
+To make the decision about which multi variant to call, Parrot takes a
+I<Manhattan Distance> between the two. Parrot calculates the I<distance>
+between the multi signatures and the argument signature. Every difference
+counts as one step. A difference can be an autobox from a primitive type
+to a PMC, or the conversion from one primitive type to another, or the
+matching of an argument to a C<_> wildcard. After Parrot calculates the
+distance to each variant, it calls the function with the lowest distance.
+Notice that it's possible to define a variant that is impossible to call:
+for every potential combination of arguments there is a better match. This
+isn't necessarily a common occurance, but it's something to watch out for
+in systems with a lot of multis.
+
+=cut
 
 # Local variables:
 #   c-file-style: "parrot"

Modified: branches/vtable_morph_change/docs/book/ch05_pasm.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch05_pasm.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch05_pasm.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -244,7 +244,7 @@
 
 Z<CHP-5-SECT-2.2.2>
 
-X<PMCs (Parrot Magic Cookies);object types>
+X<PMCs (Polymorphic Containers);object types>
 Internally, PMC types are represented by positive integers, and
 built-in types by negative integers. PASM provides two opcodes to deal
 with types. Use C<typeof> to look up the name of a type from its
@@ -262,7 +262,7 @@
 
 In this example, C<typeof> returns the type name "String".
 
-X<PMCs (Parrot Magic Cookies);inheritance>
+X<PMCs (Polymorphic Containers);inheritance>
 X<Parrot;classes;inheritance>
 X<inheritance;with PMCs>
 All Parrot classes inherit from the class C<default>. The
@@ -337,7 +337,7 @@
   mul P0, P1, I2
   mul P0, P1, N2
 
-X<PMCs (Parrot Magic Cookies);operations on>
+X<PMCs (Polymorphic Containers);operations on>
 Operations on a PMC are implemented by the vtable method of the
 destination (in the two-argument form) or the left source argument (in
 the three argument form). The result of an operation is entirely
@@ -456,7 +456,7 @@
 to the new string. The second C<concat> concatenates "xy" onto the
 string "abcd" in C<S0> and stores the new string in C<S1>.
 
-X<PMCs (Parrot Magic Cookies);concatenation>
+X<PMCs (Polymorphic Containers);concatenation>
 For PMC registers, C<concat> has only a three-argument form with
 separate registers for source and destination:
 
@@ -1182,8 +1182,8 @@
 
 Z<CHP-5-SECT-3>
 
-In most of the examples we've shown so far, X<PMCs (Parrot Magic
-Cookies);working with> PMCs just duplicate the functionality of
+In most of the examples we've shown so far, X<PMCs (Polymorphic
+Containers);working with> PMCs just duplicate the functionality of
 integers, numbers, and strings. They wouldn't be terribly useful if
 that's all they did, though. PMCs offer several advanced features,
 each with its own set of operations.
@@ -1193,7 +1193,7 @@
 Z<CHP-5-SECT-3.1>
 
 PMCs can define complex types that hold multiple values. These are
-commonly called "X<PMCs (Parrot Magic Cookies);aggregate>
+commonly called "X<PMCs (Polymorphic Containers);aggregate>
 X<aggregate PMCs> aggregates." The most important feature added for
 aggregates is keyed access. Elements within an aggregate PMC can be
 stored and retrieved by a numeric or string key. PASM also offers a
@@ -1208,7 +1208,7 @@
 
 Z<CHP-5-SECT-3.1.1>
 
-X<PMCs (Parrot Magic Cookies);arrays>
+X<PMCs (Polymorphic Containers);arrays>
 The C<Array>X<Array PMC> PMC is an ordered aggregate with
 zero-based integer keys. The syntax for X<keyed access to PMCs> keyed access to a
 PMC puts the key in square brackets after the register name:
@@ -1250,7 +1250,7 @@
 
 Z<CHP-5-SECT-3.1.2>
 
-X<PMCs (Parrot Magic Cookies);hashes>
+X<PMCs (Polymorphic Containers);hashes>
 The C<Hash>X<Hash PMC> PMC is an unordered aggregate with
 string keys:
 
@@ -1332,7 +1332,7 @@
 
 Z<CHP-5-SECT-3.1.4>
 
-X<PMCs (Parrot Magic Cookies);data structures>
+X<PMCs (Polymorphic Containers);data structures>
 Arrays and hashes can hold any data type, including other aggregates.
 Accessing elements deep within nested data structures is a common
 operation, so PASM provides a way to do it in a single instruction.
@@ -1362,8 +1362,8 @@
 
 Z<CHP-5-SECT-3.2>
 
-We mentioned before that C<set> on two X<PMCs (Parrot Magic
-Cookies);assignment> PMCs simply aliases them both to the same object,
+We mentioned before that C<set> on two X<PMCs (Polymorphic
+Containers);assignment> PMCs simply aliases them both to the same object,
 and that C<clone> creates a complete duplicate object. But if you just
 want to assign the value of one PMC to another PMC, you need the
 C<assign>X<assign opcode (PASM)> opcode:
@@ -1394,7 +1394,7 @@
 
 Z<CHP-5-SECT-3.3>
 
-X<PMCs (Parrot Magic Cookies);properties>
+X<PMCs (Polymorphic Containers);properties>
 PMCs can have additional values attached to them as "properties" of
 the PMC. What these properties do is entirely up to the language being
 implemented. Perl 6 uses them to store extra information about a
@@ -2931,86 +2931,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/book/ch06_library.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch06_library.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch06_library.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -101,87 +101,7 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#  
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:
-# vim: expandtab shiftwidth=4:
\ No newline at end of file
+# vim: expandtab shiftwidth=4:

Modified: branches/vtable_morph_change/docs/book/ch07_testing_and_debugging.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch07_testing_and_debugging.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch07_testing_and_debugging.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -122,86 +122,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#  
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/book/ch08_architecture.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch08_architecture.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch08_architecture.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -819,7 +819,7 @@
 but trust us when we say it's something worth being concerned with.
 
 X<Parrot;native data type;;(see PMCs)>
-X<PMCs (Parrot Magic Cookies);Parrot's native data type> 
+X<PMCs (Polymorphic Containers);Parrot's native data type> 
 PMCs are complex structures, even the simplest ones. We can't count on
 the hardware or even the operating system to provide us atomic access.
 Parrot has to provide that atomicity itself, which is expensive. Getting
@@ -901,7 +901,7 @@
 
 Z<CHP-8-SECT-5.1>
 
-X<PMCs (Parrot Magic Cookies);handling method calls>
+X<PMCs (Polymorphic Containers);handling method calls>
 Parrot's object system is very simple--in fact, a PMC only has to handle
 method calls to be considered an object. Just handling methods covers
 well over 90% of the object functionality that most programs use, since
@@ -1038,7 +1038,7 @@
 has some strict rules over what can be referenced and from where.
 This allows it to have a more efficient garbage collection system.
 
-X<PMCs (Parrot Magic Cookies);garbage collection and>
+X<PMCs (Polymorphic Containers);garbage collection and>
 X<garbage collection;Parrot;PMC and>
 The first allocation system is responsible for PMC and string
 structures. These are fixed-sized objects that Parrot allocates out of
@@ -1265,86 +1265,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#  
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/book/ch09_pct.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch09_pct.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch09_pct.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -719,86 +719,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#  
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/book/ch10_hlls.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch10_hlls.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch10_hlls.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -260,86 +260,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#  
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/book/ch11_pmcs.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch11_pmcs.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch11_pmcs.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -231,86 +231,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/book/ch12_opcodes.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch12_opcodes.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch12_opcodes.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,260 +1,21 @@
 =pod
 
-=head1 Opcodes and Runcores
+=head1 Opcodes
 
 Z<CHP-12>
 
-The smallest executable component is not the compilation unit or even
-the subroutine, but is actually the opcode. Opcodes in PASM, like opcodes
-in other assembly languages, are individual instructions that implement
-low-level operations in Parrot N<In the world of microprocessors, the
-word "opcode" typically refers to the numeric identifier for each
-instructions. The human-readable word used in the associated assembly
+The smallest executable component is not the compilation unit or even the
+subroutine, but is actually the opcode. Opcodes in Parrot, like opcodes in
+other machines (both virtual and physical), are individual instructions that
+implement low-level operations in the machine. In the world of
+microprocessors, the word "opcode" typically refers to the numeric identifier
+for each instructions. The human-readable word used in the associated assembly
 language is called the "mnemonic". An assembler, among other tasks, is
-responsible for converting mnemonics into opcodes for execution. In
-Parrot, instead of referring to an instruction by different names
-depending on what form it's in, we just call them all "opcodes">. Of
-course the list of things that qualify as "low-level" in Parrot can be
-pretty advanced compared to the functionality supplied by regular
-assembly language opcodes.
-
-Before we talk about opcodes, we shall discuss a little bit about
-the various runcores that invoke them.
-
-=head2 Runcores
-
-During execution, the runcore is like the heart of Parrot. The runcore
-controls calling the various opcodes with the correct data, and making
-sure that program flow moves properly. Some runcores, such as the
-I<precomputed C goto runcore> are optimized for speed and don't perform
-many tasks beyond finding and dispatching opcodes. Other runcores,
-such as the I<GC-Debug>, I<debug> and I<profiling> runcores help with
-typical software maintenance and analysis tasks. We'll talk about all
-of these throughout the chapter.
-
-Runcores must pass execution to each opcode in the incoming bytecode
-stream. This is called I<dispatching> the opcodes. Because the different
-runcores are structured in different ways, the opcodes themselves must
-be formated differently. The opcode compiler compiles opcodes into a
-number of separate formats, depending on what runcores are included in
-the compiled Parrot. Because of this, understanding opcodes first
-requires an understanding of the Parrot runcores.
-
-=head3 Types of Runcores
-
-Parrot has multiple runcores. Some are useful for particular maintenance
-tasks, some are only available as optimizations in certain compilers,
-some are intended for general use, and some are just interesting flights
-of fancy with no practical benefits. Here we list the various runcores,
-their uses, and their benefits.
-
-=over 4
-
-=item * Slow Core
-
-The slow core is a basic runcore design that treats each opcode as a
-separate function at the C level. Each function is called, and returns
-the address of the next opcode to be called by the core. The slow core
-performs bounds checking to ensure that the next opcode to be called is
-properly in bounds, and not somewhere random in memory. Because of this
-modular approach where opcodes are treated as separate executable
-entities many other runcores, especially diagnostic and maintenance
-cores are based on this design. The program counter C<pc> is the current
-index into the bytecode stream. Here is a pseudocode representation for
-how the slow core works:
-
-  while(1) {
-      pc = NEXT_OPCODE;
-	  if(pc < LOW_BOUND || pc > HIGH_BOUND)
-	      throw exception;
-	  DISPATCH_OPCODE(pc);
-	  UPDATE_INTERPRETER();
-  }
-
-=item * Fast Core
-
-The fast core is a bare-bones core that doesn't do any of the
-bounds-checking or context updating that the slow core does. The fast
-core is the way Parrot should run, and is used to find and debug places
-where execution strays outside of its normal bounds. In pseudocode, the
-fast core is very much like the slow core except it doesn't do the bounds
-checking between each instruction, and doesn't update the interpreter's
-current context for each dispatch.
-
-  while(1) {
-      pc = NEXT_OPCODE;
-	  DISPATCH_OPCODE(pc);
-  }
-
-=item * Switch Core
-
-As its name implies, the switch core uses a gigantic C C<switch / case>
-structure to execute opcodes. Here's a brief example of how this
-architecture works:
-
-  for( ; ; current_opcode++) {
-      switch(*current_opcode) {
-	      case opcode_1:
-		      ...
-	      case opcode_2:
-		      ...
-		  case opcode_3:
-		      ...
-	  }
-  }
-
-This is quite a fast architecture for dispatching opcodes because it all
-happens within a single function. The only operations performed between
-opcodes is a jump back to the top of the loop, incrementing the opcode
-pointer, dereferencing the opcode pointer, and then a jump to the C<case>
-statement for the next opcode.
-
-=item * Computed Goto Core
-
-I<Computed Goto> is a feature of some C compilers where a label is
-treated as a piece of data that can be stored as a C<void *> pointer. Each
-opcode becomes simply a label in a very large function, and pointers to the
-labels are stored in a large array. Calling an opcode is as easy as taking
-that opcode's number as the index of the label array, and calling the
-associated label. Sounds complicated? It is a little, especially to C
-programmers who are not used to using labels, much less treating them as
-first class data items.
-
-Notice that computed goto is a feature only available in some compilers
-such as GCC, and will not be available in every distribution of Parrot,
-depending what compilers were used to build it.
-
-As was mentioned earlier, not all compilers support computed goto, which
-means that this core will not be built on platforms that don't support it.
-However, it's still an interesting topic to study so we will look at it
-briefly here. For compilers that support it, computed goto labels are
-C<void **> values. In the computed goto core, all the labels represent
-different opcodes, so they are stored in an array:
-
-  void *my_labels[] = {
-      &&label1,
-	  &&label2,
-	  &&label3
-  };
-  
-  label1:
-      ...
-  label2:
-      ...
-  label3:
-      ...
-
-Jumping to one of these labels is done with a command like this:
-
-  goto *my_labels[opcode_number];
-
-Actually, opcodes are pointed to by an C<opcode_t *> pointer, and all
-opcodes are stored sequentially in memory, so the actual jump in the
-computed goto core must increment the pointer and then jump to the new
-version. In C it looks something like this:
-
-  goto *my_labels[*(current_opcode += 1)];
-
-Each opcode is an index into the array of labels, and at the end of each
-opcode an instruction like this is performed to move to the next opcode
-in series, or else some kind of control flow occurs that moves it to a
-non-sequential location:
-
-  goto *my_lables[*(current_opcode = destination)];
-
-These are simplifications on what really happens in this core, because
-the actual code has been optimized quite a bit from what has been
-presented here. However, as we shall see with the precomputed goto core,
-it isn't optimized as aggressively as is possible.
-
-=item * Precomputed Goto Core
-
-The precomputed goto core is an amazingly fast optimized core that uses
-the same computed goto feature, but performs the array dereferencing
-before the core even starts. The compiled bytecode is fed into a
-preprocessor that converts the bytecode instruction numbers into label
-pointer values. In the computed goto core, you have this
-operation to move to the next opcode:
-
-  goto *my_labels[*(current_opcode += 1)];
-
-This single line of code is deceptively complex. A number of machine code
-operations must be performed to complete this step: The value of
-C<current_opcode> must be incremented to the next value, that value must
-be dereferenced to find the opcode value. In C, arrays are pointers, so
-C<my_labels> gets dereferenced and an offset is taken from it to find
-the stored label reference. That label reference is then dereferenced, and
-the jump is performed.
-
-That's a lot of steps to execute before we can jump to the next opcode.
-What if each opcode value was replaced with the value of the jump
-label beforehand? If C<current_opcode> points to a label pointer directly,
-we don't need to perform an additional dereference on the array at all. We
-can replace that entire mess above with this line:
-
-  goto **(current_opcode += 1);
-
-That's far fewer machine instructions to execute before we can move to the
-next opcode, which means faster throughput. Remember that whatever dispatch
-mechanism is used will be called after every single opcode, and some large
-programs may have millions of opcodes! Every single machine instruction
-that can be cut out of the dispatch mechanism could increase the execution
-speed of Parrot in a significant and noticable way. N<The dispatch mechanism
-used by the various runcores is hardly the largest performance bottleneck in
-Parrot anyway, but we like to use faster cores to shave every little bit of
-speed out of the system>.
-
-The caveat of course is that the predereferenced computed goto core is only
-available with compilers that support computed goto, such as GCC. Parrot
-will not have access to this core if it is built with a different compiler.
-
-=item * JIT Core
-
-=item * Exec Core
-
-=item * Tracing Core
-
-=item * Profiling Core
-
-The profiling core analyzes the performance of Parrot, and helps to
-determine where bottlenecks and trouble spots are in the programs that
-run on top of Parrot. When Parrot calls a PIR subroutine it sets up the
-environment, allocates storage for the passed parameters and the return
-values, passes the parameters, and calls a new runcore to execute it. To
-calculate the amount of time that each subroutine takes, we need to
-measure the amount of time spent in each runcore from the time the core
-begins to the time the core executes. The profiling core does exactly
-this, acting very similarly to a slow core but also measuring the amount
-of time it takes for the core to complete. The tracing core actually
-keeps track of a few additional values, including the number of GC cycles
-run while in the subroutine, the number of each opcode called and the
-number of calls to each subroutine made. All this information is helpfully
-printed to the STDERR output for later analysis.
-
-=item * GC Debug Core
-
-Parrot's garbage collector has been known as a weakness in the system
-for several years. In fact, the garbage collector and memory management
-subsystem was one of the last systems to be improved and rewritten before
-the release of version 1.0. It's not that garbage collection isn't
-important, but instead that it was so hard to do earlier in the project.
-
-Early on when the GC was such a weakness, and later when the GC was under
-active development, it was useful to have an operational mode that would
-really exercise the GC and find bugs that otherwise could hide by sheer
-chance. The GC debug runcore was this tool. The core executes a complete
-collection iteration between every single opcode. The throughput
-performance is terrible, but that's not the point: it's almost guaranteed
-to find problems in the memory system if they exist.
-
-=item * Debug Core
-
-The debug core works like a normal software debugger, such as GDB. The
-debug core executes each opcode, and then prompts the user to enter a
-command. These commands can be used to continue execution, step to the
-next opcode, or examine and manipulate data from the executing program.
-
-=back
+responsible for converting mnemonics into opcodes for execution. In Parrot,
+instead of referring to an instruction by different names depending on what
+form it's in, we just call them all "opcodes". Of course the list of things
+that qualify as "low-level" in Parrot can be pretty advanced compared to the
+functionality supplied by regular assembly language opcodes.
 
 =head2 Opcodes
 
@@ -465,85 +226,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
 
 # Local variables:
 #   c-file-style: "parrot"

Modified: branches/vtable_morph_change/docs/book/ch13_reference.pod
==============================================================================
--- branches/vtable_morph_change/docs/book/ch13_reference.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/book/ch13_reference.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -3637,86 +3637,6 @@
 
 =cut
 
-##########################################################################
-#                              PSEUDOPOD LEGEND
-#
-#  Interior Sequences
-#  ..................
-#  A<>         link anchor (source)
-#  B<>         bold text
-#  C<>         monospace text
-#  E<>         named character
-#  F<>         file name
-#  G<>         superscript
-#  H<>         subscript
-#  I<>         italicized text
-#  L<>         link to other manpage (see A<>)
-#  M<>         firstterm
-#  N<>         footnote
-#  Q<>         quoted text
-#  R<>         replaceable item
-#  S<>         text with non-breaking spaces
-#  T<>         cited title for book, etc.
-#  U<>         URL
-#  X<>         a single index term of the form:
-#                    primary:sortas;secondary:sortas;tertiary:sortas;;ETC
-#                    where ETC is either (see term) or (see also term)
-#                    only primary term is required
-#  Z<>         link anchor (destination)
-#
-#  Heads
-#  .....
-#  head0                    chapter title
-#  head{1-4}                section title (4 levels)
-#
-#  Command Paragraphs (begin/end Blocks)
-#  .....................................
-#  blockquote               quotation
-#  comment                  ignored text
-#  caution                  admonition
-#  epigraph                 quotation
-#  example                  container
-#  figure CAPTION           figure
-#  important                admonition
-#  note                     admonition
-#  programlisting           literal text
-#  screen                   literal text
-#  sidebar                  container
-#  table html [CAPTION]     table rendered in HTML
-#  table picture [CAPTION]  table rendered in plain text
-#  tip                      admonition
-#  warning                  admonition
-#
-#
-#  Command Paragraphs (for Blocks)
-#  ...............................
-#  This structure will be used only for comments. For example:
-#
-#    =for editor
-#    Check my spelling on this.
-#    =end
-#
-#  This will be rendered as a visible comment in the final output
-#  with a label at the top addressing it to "editor". The exception is
-#  =for ignore which will always be ignored by the parser.
-#
-#  Tables
-#  ......
-#  A 2x2 table with top header row looks like this:
-#  
-#  =begin table An Example Table
-#  =headrow
-#  =row
-#  =cell Header for first column (row 1, col 1)
-#  =cell Header for 2nd column (row 1, col 2)
-#  =bodyrows
-#  =cell Cell for row 2, col 1
-#  =cell Cell for row 2, col 2
-#  =end table
-#
-#  For more information on PSEUDOPOD, write to tools at oreilly.com
-##########################################################################
-
 # Local variables:
 #   c-file-style: "parrot"
 # End:

Modified: branches/vtable_morph_change/docs/debug.pod
==============================================================================
--- branches/vtable_morph_change/docs/debug.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/debug.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -148,7 +148,7 @@
 program has finished. To work around this, do 'si' twice just before executing
 any keyed op. For some reason, C<gdb> can then figure out when it's supposed to
 stop next. If you know of a better technique, please let the mailing list know
-(C<parrot-porters at perl.org>).
+(C<parrot-dev at lists.parrot.org>).
 
 =head1 PIR CODE GENERATION
 

Modified: branches/vtable_morph_change/docs/dev/fhs.pod
==============================================================================
--- branches/vtable_morph_change/docs/dev/fhs.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/dev/fhs.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -56,7 +56,7 @@
 
 This is the primary directory of executable commands on the system. All
 executables that are intended to be called directly by the user (i.e.
-parrot, pdump, disassemble, parrot-debugger, pbc_info,  pbg_merge, ...)
+parrot, parrot_debugger, pbc_disassemble, pbc_dump, pbc_info, pbg_merge, ...)
 should go here. The current version number should be appended to the
 binaries itself and a symlink needs to be created that points from the
 binary with version number to the normal name of the file without a

Modified: branches/vtable_morph_change/docs/embed.pod
==============================================================================
--- branches/vtable_morph_change/docs/embed.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/embed.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -67,7 +67,7 @@
 
 =item C<Parrot_PMC>
 
-A Parrot Magic Cookie.  This is the opaque external type for (PMC *).  Note
+A Polymorphic Container.  This is the opaque external type for (PMC *).  Note
 that this is a macro, so there can be only one C<Parrot_PMC> declaration per
 line.
 

Modified: branches/vtable_morph_change/docs/glossary.pod
==============================================================================
--- branches/vtable_morph_change/docs/glossary.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/glossary.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -264,14 +264,13 @@
 
 =item PMC
 
-Parrot Magic Cookie:  these classes are the primitives that
+Polymorphic Container:  these classes are the primitives that
 HLLs use to represent their fundamental types, such as Perl's
 scalar values.
 
-=item POD
+=item Pod
 
-(Perl's) Plain Old Documentation: the preferred form for all kinds of
-documentation in Parrot. See L<perlpod> for details.
+The preferred format for all kinds of documentation in Parrot.
 
 =item POST
 

Modified: branches/vtable_morph_change/docs/imcc/README
==============================================================================
--- branches/vtable_morph_change/docs/imcc/README	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/imcc/README	Tue Feb 10 02:09:33 2009	(r36517)
@@ -57,7 +57,7 @@
 arguments.
 
 
-Please mail parrot-porters at perl.org with bug-reports or patches.
+Please mail parrot-dev at lists.parrot.org with bug-reports or patches.
 
 
 Original Author:

Modified: branches/vtable_morph_change/docs/intro.pod
==============================================================================
--- branches/vtable_morph_change/docs/intro.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/intro.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -98,7 +98,7 @@
 
 =head2 PMCs
 
-PMC stands for Parrot Magic Cookie. PMCs represent any complex data structure
+PMC stands for Polymorphic Container. PMCs represent any complex data structure
 or type, including aggregate data types (arrays, hash tables, etc). A PMC can
 implement its own behavior for arithmetic, logical and string operations
 performed on it, allowing for language-specific behavior to be introduced. PMCs
@@ -387,9 +387,9 @@
 =head2 The Parrot Mailing List
 
 Much Parrot development and discussion takes place on the
-parrot-porters mailing list. You can subscribe by sending an email to
-C<parrot-porters-subscribe at perl.org> or read the NNTP archive at
-L<http://www.nntp.perl.org/group/perl.perl6.internals>.
+parrot-dev mailing list. You can subscribe by filling out the form at
+L<http://lists.parrot.org/mailman/listinfo/parrot-dev> or read the NNTP
+archive at L<http://groups.google.com/group/parrot-dev/>.
 
 =head2 IRC
 

Modified: branches/vtable_morph_change/docs/overview.pod
==============================================================================
--- branches/vtable_morph_change/docs/overview.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/overview.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -37,7 +37,7 @@
 To be more specific about the software CPU, it will contain a large number of
 registers. The current design provides for four groups of N registers; each
 group will hold a different data type: integers, floating-point numbers,
-strings, and PMCs. (Parrot Magic Cookies, detailed below.)
+strings, and PMCs. (Polymorphic Containers, detailed below.)
 
 Registers will be stored in register frames, which can be pushed and popped
 onto the register stack. For instance, a subroutine or a block might need its

Modified: branches/vtable_morph_change/docs/parrot.pod
==============================================================================
--- branches/vtable_morph_change/docs/parrot.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/parrot.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -126,8 +126,8 @@
 =head2 Authors
 
 Parrot is developed and maintained by the members of the
-C<parrot-porters at perl.org> mailing list. The list is archived at:
-L<http://nntp.perl.org/group/perl.perl6.internals>
+C<parrot-dev at lists.parrot.org> mailing list. The list is archived at:
+L<http://groups.google.com/group/parrot-dev/>
 
 =over 4
 

Modified: branches/vtable_morph_change/docs/parrotbyte.pod
==============================================================================
--- branches/vtable_morph_change/docs/parrotbyte.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/parrotbyte.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -25,8 +25,8 @@
 
 The B<Wordsize> (or C<opcode_t> size) must be 4 (32-bit) or 8 (64 bit). The
 bytecode loader is responsible for transforming the file into the VM native
-wordsize on the fly. For performance, a utility F<pdump> is provided to convert
-PBCs on disk if they cannot be recompiled. See F<src/pdump.c> for more
+wordsize on the fly. For performance, a utility F<pbc_dump> is provided to convert
+PBCs on disk if they cannot be recompiled. See F<src/pbc_dump.c> for more
 information.
 
 B<Byteorder> currently supports two values: (0-Little Endian, 1-Big Endian)
@@ -333,7 +333,7 @@
 =head1 SEE ALSO
 
 F<packfile.c>, F<packfile.h>, F<packout.c>, F<packdump.c>, F<pf/*.c>, and the
-B<pdump> utility F<pdump.c>.
+B<pbc_dump> utility F<pbc_dump.c>.
 
 =head1 AUTHOR
 

Modified: branches/vtable_morph_change/docs/pct/gettingstarted.pod
==============================================================================
--- branches/vtable_morph_change/docs/pct/gettingstarted.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pct/gettingstarted.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -225,6 +225,6 @@
 =head1 SUGGESTIONS
 
 If you have suggestions, improvements, tips or complaints about this document,
-please send an email to C<parrot-dev at parrot.org>.
+please send an email to C<parrot-dev at lists.parrot.org>.
 
 =cut

Deleted: branches/vtable_morph_change/docs/pdds/README
==============================================================================
--- branches/vtable_morph_change/docs/pdds/README	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,19 +0,0 @@
-PDD SPRING CLEANING IN PROGRESS
-
-The PDDs have gotten stale and dusty, and I think a family of cockatiels
-has built a nest back behind pdd03.  So it's time for PDD spring cleaning!
-(Yes, I know it's October, but cockatiels are from Australia.)
-
-The first step is emptying out the room by moving all the current PDDs to
-the "draft" directory.  That directory is for PDDs that have not yet been
-put under the knife for review and modification or deletion, as well as
-new PDDs that have not been approved.
-
-I'll be posting requests for help specific to the work of the moment
-to p6i.  In the meantime, if you want to document how the current
-Parrot works (i.e. fix pdd bugs), while I wouldn't embark on a rewrite
-of any documents, it would be OK to add notes to the draft PDDs.  Think
-of them as Wiki pages, but without the HTML.  (If you don't have a
-commit bit, and you start submitting doc patches, somehow I think we'll
-be able to find a commit bit for you.  :-))
-

Modified: branches/vtable_morph_change/docs/pdds/draft/pdd30_install.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/draft/pdd30_install.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/draft/pdd30_install.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -90,11 +90,16 @@
 named C<['Foo';'Bar']> is stored in
 F<usr/lib/parrot/<version>/languages/<mylang>/library/Foo/Bar.pbc>
 
-=item F</usr/lib/parrot/tools/>
+=item F</usr/lib/parrot/<version>/tools/>
 
 Parrot tools that don't belong in the bin/ directory and don't belong in the
 runtime, corresponds to F<tools/dev/> and/or F<tools/build> in the repository.
 
+=item F</usr/share/doc/parrot/<version/>
+
+Parrot documentation files, generally raw Pod, but possibly also formatted
+HTML. May have subdirectories F<pod/>, F<html/>, etc.
+
 =back
 
 Bootstrapping the configuration hash should not read a config file when the

Modified: branches/vtable_morph_change/docs/pdds/pdd00_pdd.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd00_pdd.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd00_pdd.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,24 +1,22 @@
 # Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Parrot Design Documents
 
-docs/pdds/pdd00_pdd.pod - Parrot Design Documents
-
-=head1 VERSION
+=head1 Version
 
 $Revision$
 
-=head1 ABSTRACT
+=head2 Abstract
 
 This document defines the content and format of Parrot Design Documents
 (PDDs).
 
-=head1 SYNOPSIS
+=head2 Synopsis
 
 Not applicable.
 
-=head1 DESCRIPTION
+=head2 Description
 
 PDDs are living documents, which should be maintained to reflect the current
 and contemplated design of Parrot.
@@ -58,14 +56,14 @@
 they don't, just to keep the PDDs relatively short and readable. The history
 of Parrot's design is retrievable from the source repository.
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 All newly created PDDs will adhere to the PDD standard current as of the time
 of proposal. An example of the currently accepted layout is given in
 F<docs/pdds/pdd_template.pod>, which should be used as a template for any
 future PDDs.
 
-=head2 FORMAT
+=head3 Format
 
 All PDDs will be written in POD parseable by the current stable release of
 Perl 5. Although XML is a viable solution and has its vocal supporters, and
@@ -90,44 +88,44 @@
 
 =over 4
 
-=item NAME:
+=item I<name>:
 
 A short, general description of a specific part of the Parrot design. This may
 be a particular subsystem (e.g. the garbage collector), or a more general
 topic (e.g. basic Parrot datatypes).
 
-=item VERSION:
+=item Version:
 
 Document version.  Since Parrot is currently kept in a Subversion repository,
 the $$-delimited keyword "Revision" will do nicely.
 
-=item MAINTAINER I<(optional)>:
+=item Maintainer I<(optional)>:
 
 The name and current email address for the point of contact for the PDD. This
 is the person to whom questions, comments, and patches should generally be
 addressed. This need not be the author of the document.  By default, all PDDs
 are maintained by the Parrot Architect.
 
-=item ABSTRACT:
+=item Abstract:
 
 A quick blurb explaining the purpose of the PDD.
 
-=item SYNOPSIS I<(optional)>:
+=item Synopsis I<(optional)>:
 
 Code snippets showing the semantics of the PDD (if applicable).
 
-=item DESCRIPTION:
+=item Description:
 
 A description of the general nature of the PDD and how it relates to
 Parrot.
 
-=item IMPLEMENTATION:
+=item Implementation:
 
 A major section of the PDD that encapsulates a free-form discussion of any and
 all applicable information related to the final observations, conclusions, and
 what-have-you that required writing the document in the first place.
 
-=item ATTACHMENTS:
+=item Attachments:
 
 References to supporting files that should be considered part of the PDD.
 Text files and image files may be in any widely accepted format, which is
@@ -137,7 +135,7 @@
 fair hiding all the info in an attachment just to not have to write an
 implementation section.
 
-=item REFERENCES:
+=item References:
 
 References to additional sources of information, but not those necessary for
 the PDD itself.
@@ -146,13 +144,13 @@
 
 The PDD author may add any additional sections he or she wishes.
 
-=head2 SUBMISSION CRITERIA
+=head3 Submission Criteria
 
-Proposed PDDs should be submitted to the parrot-porters mailing list (located
-at parrot-porters at perl.org) for discussion, criticism and general kibitzing.
+Proposed PDDs should be submitted to the parrot-dev mailing list (located
+at parrot-dev at lists.parrot.org) for discussion, criticism and general kibitzing.
 Acceptance of a particular PDD is ultimately up to the Parrot Architect.
 
-=head2 PDD TRANSLATIONS
+=head3 PDD Translations
 
 Translations of PDDs into other languages should meet these guidelines:
 
@@ -160,20 +158,20 @@
 
 =item *
 
-The C<MAINTAINER> section should record who made the translation.
+The C<Maintainer> section should record who made the translation.
 
 =item *
 
-The C<VERSION> section should include an additional note of the translation
+The C<Version> section should include an additional note of the translation
 version.
 
 =back
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 (none)
 
-=head1 REFERENCES
+=head2 References
 
 (none)
 

Modified: branches/vtable_morph_change/docs/pdds/pdd03_calling_conventions.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd03_calling_conventions.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd03_calling_conventions.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,23 +1,21 @@
 # Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Parrot Calling Conventions
 
-docs/pdds/pdd03_calling_conventions.pod - Parrot Calling Conventions
-
-=head1 ABSTRACT
+=head2 Abstract
 
 Parrot's inter-routine calling conventions.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 SYNOPSIS
+=head2 Synopsis
 
 Not applicable.
 
-=head1 DESCRIPTION
+=head2 Description
 
 This document describes how to pass arguments from registers to subroutines,
 and how subroutines can extract their parameters into registers for use.
@@ -27,7 +25,7 @@
 conversion rules are the same regardless of whether code is invoking a
 subroutine or a return continuation.
 
-=head2 Common Features of Argument/Return Opcodes
+=head3 Common Features of Argument/Return Opcodes
 
 There are four opcodes involved in parameter and return value propagation:
 
@@ -73,7 +71,7 @@
 Some values and registers do not correspond directly to values passed or
 received.  (See the descriptions of the OPT_FLAG and NAMED bits, below.)
 
-=head3 Flag Words; Common Flag Word Bits
+=head4 Flag Words; Common Flag Word Bits
 
 Each integer in the flag string controls the processing of the corresponding
 value or register.
@@ -89,7 +87,7 @@
 
 Don't set these bits yourself; the assembler will do it.
 
-=head2 Passing Arguments, Returning Values
+=head3 Passing Arguments, Returning Values
 
 Just before calling a subroutine with C<invokecc> or calling a method with
 C<call_methodcc>, use the C<set_args> opcode to tell Parrot where the
@@ -100,7 +98,7 @@
 the C<set_returns> opcode to tell Parrot where the return values will
 come from and how to expand them for the caller's use.
 
-=head3 Flag Word Bits For 'Setting'
+=head4 Flag Word Bits For 'Setting'
 
 These bits of each flag word have these meanings specific to C<set_args> and
 C<set_returns>:
@@ -142,7 +140,7 @@
 
 =back
 
-=head2 Accepting Parameters, Accepting Return Values
+=head3 Accepting Parameters, Accepting Return Values
 
 As the I<first opcode> in a subroutine that will be called with
 C<invokecc> or a method that will be called with C<call_methodcc>, use
@@ -157,7 +155,7 @@
 as targets of these opcodes, not constants.  (You can't store anything into a
 constant.  That would make it a variable.)
 
-=head3 Flag Word Bits For 'Getting'
+=head4 Flag Word Bits For 'Getting'
 
 These bits of each flag word have these meanings specific to C<get_params> and
 C<get_results>:
@@ -222,7 +220,7 @@
 
 =back
 
-=head3 Overflow and underflow
+=head4 Overflow and underflow
 
 If too many or too few values are provided for the given target registers,
 Parrot by default will throw an exception for C<get_params>, but not for
@@ -243,13 +241,13 @@
 RT#45357 - which exception?  We really could use an exception subsystem.
 Oh, wait, that's my job.  Never mind.  --Chip
 
-=head3 Ordering of named values (outgoing)
+=head4 Ordering of named values (outgoing)
 
 Named values (arguments, or values to return) must be listed textually after
 all the positional values.  C<FLAT> and non-C<FLAT> values may be mixed in any
 order.
 
-=head3 Ordering of named targets (incoming)
+=head4 Ordering of named targets (incoming)
 
 Named targets (parameters, or returned values) must appear I<after> all the
 positional targets.  A C<SLURPY> positional target, if present, must be the
@@ -278,7 +276,7 @@
 
 =back
 
-=head3 Mixing named and positional values
+=head4 Mixing named and positional values
 
 Positional targets can only be filled with positional values.
 
@@ -286,7 +284,7 @@
 However, if a named target was already filled by a positional value, and
 then a named value is also given, this is an overflow error.
 
-=head3 Type Conversions
+=head4 Type Conversions
 
 Unlike the C<set_*> opcodes, the C<get_*> opcodes must perform conversion from
 one register type to another.  Here are the conversion rules:
@@ -324,11 +322,11 @@
 substitute an alternative type for each default low-level Parrot type (array,
 hash, string, number, etc.).
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 Not applicable.
 
-=head1 BUGS
+=head2 Bugs
 
 Required features are missing:
 
@@ -340,9 +338,9 @@
 
 =back
 
-=head1 PIR SYNTAX EXAMPLES
+=head2 PIR Syntax Examples
 
-=head2 Function Calls
+=head3 Function Calls
 
   foo(1, i)                       # 2 positional arguments
   foo(x, ar :flat, y)             # flattening array
@@ -353,7 +351,7 @@
   # all together now: three positional (one flat) with two named (one flat)
   foo(a, b, c :flat, 'x' => 3, 'y' => 4, z :flat :named('z'))
 
-=head2 Parameters
+=head3 Parameters
 
   .param int i                    # positional parameter
   .param pmc argv :slurpy         # slurpy array
@@ -362,20 +360,20 @@
   .param int has_x :opt_flag      # flag 0/1 x was passed
   .param pmc kw :slurpy :named    # slurpy hash
 
-=head2 Return Values
+=head3 Return Values
 
   .return (i, ar: flat, value :named('key') )
 
-=head2 Call Results
+=head3 Call Results
 
   x = foo()                       # single result
   (i, j :optional, ar :slurpy, value :named('key') ) = foo()
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
 L<pdd23_exceptions.pod>
 

Modified: branches/vtable_morph_change/docs/pdds/pdd07_codingstd.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd07_codingstd.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd07_codingstd.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,26 +1,23 @@
 # Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Conventions and Guidelines for Parrot Source Code
 
-docs/pdds/pdd07_codingstd.pod - Conventions and Guidelines for Parrot Source
-Code
-
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 ABSTRACT
+=head2 Abstract
 
 This document describes the various rules, guidelines and advice for those
 wishing to contribute to the source code of Parrot, in such areas as code
 structure, naming conventions, comments etc.
 
-=head1 SYNOPSIS
+=head2 Synopsis
 
 Not applicable.
 
-=head1 DESCRIPTION
+=head2 Description
 
 One of the criticisms of Perl 5 is that its source code is impenetrable to
 newcomers, due to such things as inconsistent or obscure variable naming
@@ -50,10 +47,10 @@
 Note that since Parrot is substantially implemented in C, these rules apply to
 C language source code unless otherwise specified.
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 
-=head2 Language Standards and Portability
+=head3 Language Standards and Portability
 
 =over 4
 
@@ -84,7 +81,7 @@
 =back
 
 
-=head2 Code Formatting
+=head3 Code Formatting
 
 The following I<must> apply:
 
@@ -239,7 +236,7 @@
 =back
 
 
-=head2 Code Structure
+=head3 Code Structure
 
 The following I<must> apply:
 
@@ -337,7 +334,7 @@
 =back
 
 
-=head2 Smart Editor Style Support
+=head3 Smart Editor Style Support
 
 All developers using Emacs must ensure that their Emacs instances load the
 elisp source file F<editor/parrot.el> before opening Parrot source files.
@@ -400,7 +397,7 @@
 list of typedefs, and parrot.el should read it or contain it. }}
 
 
-=head2 Portability
+=head3 Portability
 
 Parrot runs on many, many platforms, and will no doubt be ported to ever more
 bizarre and obscure ones over time.  You should never assume an operating
@@ -412,9 +409,9 @@
 are GNU extensions, and use them only when they're protected by #ifdefs.
 
 
-=head2 Defensive Programming
+=head3 Defensive Programming
 
-=head3 Use Parrot data structures instead of C strings and arrays
+=head4 Use Parrot data structures instead of C strings and arrays
 
 C arrays, including strings, are very sharp tools without safety guards, and
 Parrot is a large program maintained by many people.  Therefore:
@@ -427,7 +424,7 @@
 Note that efficiency of some low-level operations may be a reason to break
 this rule.  Be prepared to justify your choices to a jury of your peers.
 
-=head3 Pass only C<unsigned char> to C<isxxx()> and C<toxxx()>
+=head4 Pass only C<unsigned char> to C<isxxx()> and C<toxxx()>
 
 Pass only values in the range of C<unsigned char> (and the special value -1,
 a.k.a. C<EOF>) to the isxxx() and toxxx() library functions.  Passing signed
@@ -435,7 +432,7 @@
 behavior at best and crashes at worst.  And under most of the compilers Parrot
 targets, C<char> I<is> signed.
 
-=head3 The C<const> keyword on arguments
+=head4 The C<const> keyword on arguments
 
 Use the C<const> keyword as often as possible on pointers.  It lets
 the compiler know when you intend to modify the contents of something.
@@ -453,7 +450,7 @@
 Without the C<const>, the compiler has to assume that C<strlen()> is
 actually initializing the contents of C<p>.
 
-=head3 The C<const> keyword on variables
+=head4 The C<const> keyword on variables
 
 If you're declaring a temporary pointer, declare it C<const>, with the
 const to the right of the C<*>, to indicate that the pointer should not
@@ -476,7 +473,7 @@
         /* do something */
     }
 
-=head3 Localizing variables
+=head4 Localizing variables
 
 Declare variables in the innermost scope possible.
 
@@ -503,9 +500,9 @@
 You could hoist the C<int i;> outside the test, but then you'd have an
 C<i> that's visible after it's used, which is confusing at best.
 
-=head2 Subversion properties
+=head3 Subversion Properties
 
-=head3 svn:ignore
+=head4 svn:ignore
 
 Sometimes new files will be created in the configuration and build process of
 Parrot. These files should not show up when checking the distribution with
@@ -527,7 +524,7 @@
 
 and the files then committed to the Parrot svn repository.
 
-=head3 svn:mime-type
+=head4 svn:mime-type
 
 The C<svn:mime-type> property must be set to C<text/plain> for all test
 files, and may be set to C<text/plain> for other source code files in
@@ -543,7 +540,7 @@
 The F<t/distro/file_metadata.t> test checks that the files needing
 this property have it set.
 
-=head3 svn:keywords
+=head4 svn:keywords
 
 The C<svn:keywords> property should be set to:
 
@@ -556,7 +553,7 @@
 The F<t/distro/file_metadata.t> test checks that the files needing
 this property have it set.
 
-=head3 svn:eol-style
+=head4 svn:eol-style
 
 The C<svn:eol-style> property makes sure that whenever a file is checked out
 of subversion it has the correct end-of-line characters appropriate for
@@ -578,7 +575,7 @@
 The F<t/distro/file_metadata.t> test checks that the files needing
 this property have it set.
 
-=head2 Naming conventions
+=head3 Naming Conventions
 
 =over 4
 
@@ -798,7 +795,7 @@
 =back
 
 
-=head2 Code comments
+=head3 Code Comments
 
 The importance of good code documentation cannot be stressed enough. To make
 your code understandable by others (and indeed by yourself when you come to
@@ -930,7 +927,7 @@
 
 =back
 
-=head2 Extensibility
+=head3 Extensibility
 
 Over the lifetime of Parrot, the source code will undergo many major changes
 never envisaged by its original authors. To this end, your code should balance
@@ -956,7 +953,7 @@
 Of course, private code hidden behind an API can play more fast and loose than
 code which gets exposed.
 
-=head2 Performance
+=head3 Performance
 
 We want Parrot to be fast. Very fast. But we also want it to be portable and
 extensible. Based on the 90/10 principle, (or 80/20, or 95/5, depending on who
@@ -979,7 +976,7 @@
 
 And remember to document it.
 
-=head1 EXEMPTIONS
+=head2 Exemptions
 
 Not all files can strictly fall under these guidelines as they are
 automatically generated by other tools, or are external files included in
@@ -993,7 +990,7 @@
 or C<is_perl_exemption()>).  One can use wildcards in the list to exempt,
 for example, all files under a given directory.
 
-=head1 REFERENCES
+=head2 References
 
 none
 

Modified: branches/vtable_morph_change/docs/pdds/pdd09_gc.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd09_gc.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd09_gc.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,34 +1,32 @@
 # Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Garbage Collection Subsystem
 
-docs/pdds/pdd09_gc.pod - Garbage Collection Subsystems
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This PDD specifies Parrot's garbage collection subsystems.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DEFINITIONS
+=head2 Definitions
 
-=head2 Garbage collection (GC)
+=head3 Garbage collection (GC)
 
 Garbage collection is a process of freeing up memory that is no longer used by
 the interpreter, by determining which objects will not be referenced again and
 can be reclaimed.
 
-=head2 Simple mark
+=head3 Simple mark
 
 All reachable objects are marked as alive, first marking a root set, and then
 recursively marking objects reachable from other reachable objects. Objects
 not reached are considered dead. After collection, all objects are reset to
 unmarked, and the process starts again.
 
-=head2 Tri-color mark
+=head3 Tri-color mark
 
 Instead of a simple separation of marked (as live) and unmarked (dead), the
 object set is divided into three parts: white, gray, and black. The white
@@ -46,12 +44,12 @@
 The advantage of a tri-color mark over a simple mark is that it can be broken
 into smaller stages.
 
-=head2 Mark-and-sweep
+=head3 Mark-and-sweep
 
 In this GC scheme, after all reachable objects are marked as live, a sweep
 through the object arenas collects all unmarked objects.
 
-=head2 Mark-and-don't-sweep
+=head3 Mark-and-don't-sweep
 
 In this scheme, all objects are marked black (live) when created. White
 objects are free memory available for allocation. When no white objects remain
@@ -63,19 +61,19 @@
 changing the interpretation of the mark bit, for example, from 1 == black to 1
 == white.
 
-=head2 Copying collection
+=head3 Copying collection
 
 In this scheme, live objects are copied into a new memory region. The entire
 old memory region can then be reclaimed.
 
-=head2 Compacting collection
+=head3 Compacting collection
 
 In this scheme, live objects are moved closer together, eliminating fragments
 of free space between live objects. This compaction makes later allocation of
 new objects faster, since the allocator doesn't have to scan for fragments of
 free space.
 
-=head2 Reference counting
+=head3 Reference counting
 
 In this scheme, all objects have a count of how often they are referred to by
 other objects. If that count reaches zero, the object's memory can be
@@ -83,7 +81,7 @@
 objects, all referencing one another but not reachable from elsewhere, never
 get collected.
 
-=head2 Stop-the-world
+=head3 Stop-the-world
 
 A common disadvantage of a simple mark implemenation is that the entire system
 (including all threads that use the same memory pools) must be suspended while
@@ -91,17 +89,17 @@
 operation continues only after the whole GC cycle is performed. This can lead
 to arbitrarily long pauses during program execution.
 
-=head2 Incremental
+=head3 Incremental
 
 Rather than suspending the system for marking and collection, GC is done in
 small increments intermittent with normal program operation. Some
 implementations perform the marking as part of ordinary object access.
 
-=head2 Real-time
+=head3 Real-time
 
 The pauses caused by GC don't exceed a certain limit.
 
-=head2 Generational
+=head3 Generational
 
 The object space is divided between a young generation (short-lived
 temporaries) and one or more old generations. Only young generations are reset
@@ -113,17 +111,17 @@
 mark-and-sweep or copying collection scheme, one for light collection runs
 performed frequently, and the other for more complete runs performed rarely.
 
-=head2 Concurrent
+=head3 Concurrent
 
 GC marking and collection runs as a separate thread, sometimes with multiple
 threads participating in GC. On a multi-processor machine, concurrent GC may
 be truly parallel.
 
-=head1 SYNOPSIS
+=head2 Synopsis
 
 Not applicable.
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 4
 
@@ -143,7 +141,7 @@
 
 =back
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 Parrot supports pluggable garbage collection cores, so ultimately any garbage
 collection model devised can run on it. However, different GC models are more
@@ -161,7 +159,7 @@
 The primary GC model for PMCs, at least for the 1.0 release, will use a
 tri-color incremental marking scheme, combined with a concurrent sweep scheme.
 
-=head2 Terminology
+=head3 Terminology
 
 A GC run is composed of two distinct operations: Finding objects which are
 dead (the "trace" phase) and freeing dead objects for later reuse (the
@@ -170,7 +168,7 @@
 "dead object detection" phase. The use of the term "dead object detection"
 and it's acronym DOD has been deprecated.
 
-=head2 Initial Marking
+=head3 Initial Marking
 
 Each PMC has a C<flags> member which, among other things, facilitates garbage
 collection. At the beginning of the mark phase, the C<PObj_is_live_FLAG> and
@@ -205,7 +203,7 @@
 
 =back
 
-=head2 Incremental Marking
+=head3 Incremental Marking
 
 After the root set of PMCs have been marked, a series of incremental mark runs
 are performed. These may be performed frequently, between other operations.
@@ -221,7 +219,7 @@
 set). A limit may be placed on the number of PMCs handled in each incremental
 mark run.
 
-=head2 Buffer Marking
+=head3 Buffer Marking
 
 The initial marking phase also marks the root set of buffers. Because buffers
 cannot contain other buffers, they are immediately marked as black and not
@@ -244,14 +242,14 @@
 Once a buffer is found to be live, the C<flags> member of the buffer structure
 has the C<PObj_live_FLAG> and C<PObj_is_fully_marked_FLAG> bits set.
 
-=head2 Collection
+=head3 Collection
 
 When the list for further marking is empty (all gray PMCs have changed to
 black), the collection stage is started. First, PMCs are collected, followed
 by buffers. In both cases (PMC and buffer), the "live" and "fully_marked"
 flags are reset after examination for reclamation.
 
-=head3 Collecting PMCs
+=head4 Collecting PMCs
 
 To collect PMCs, each PMC arena is examined from the most recently created
 backwards.  Each PMC is examined to see if it is live, already on the free
@@ -262,14 +260,14 @@
 Are the PMCs in the arena examined back-to-front as well?  How about Buffers?
 Order of destruction can be important.
 
-=head3 Collecting buffers
+=head4 Collecting buffers
 
 To collect buffers, each Buffer arena is examined from the most recently
 created backwards.  If the buffer is not live, not already on the free list
 and it is not a constant or copy on write, then it is added to the free pool
 for reuse and marked with the C<PObj_on_free_list_FLAG>.
 
-=head3 Concurrent collection
+=head4 Concurrent collection
 
 For the most part, the variable sets between concurrent tasks don't interact.
 They have independent root sets and don't require information on memory usage
@@ -287,7 +285,7 @@
 lazily, and does not require a stop-the-world sweep through all concurrent
 tasks simultaneously.
 
-=head2 Internal Structures
+=head3 Internal Structures
 
 The different GC cores are independent, but they share some code and
 resources.  The arena structures and arena creation routines are common across
@@ -296,7 +294,7 @@
 The main interpreter structure has an arena_base member, which is a pointer to
 an Arenas struct.
 
-=head3 The Arenas structure
+=head4 The Arenas structure
 
 The Arenas structure contains pointers to a variety of memory pools, each used
 for a specific purpose. Two are Memory_Pool pointers (memory_pool,
@@ -315,13 +313,13 @@
 The pointer C<void *gc_private> is reserved for use by the currently active GC
 subsystem (with freedom for variation between GC implementations).
 
-=head3 The Memory_Pool structure
+=head4 The Memory_Pool structure
 
 The Memory_Pool structure is a simple memory pool. It contains a pointer to
 the top block of the allocated pool, the total allocated size of the pool, the
 block size, and some details on the reclamation characteristics of the pool.
 
-=head3 The Small_Object_Pool structure
+=head4 The Small_Object_Pool structure
 
 The Small_Object_Pool structure is a richer memory pool for object allocation.
 It tracks details like the number of allocated and free objects in the pool, a
@@ -330,7 +328,7 @@
 Memory_Pool (the base storage of the pool). It holds function pointers for
 adding and retrieving free objects in the pool, and for allocating objects.
 
-=head2 Internal API
+=head3 Internal API
 
 Currently only one GC system is active at a time, selected at configure or
 compile time. Future versions will support switching GC systems at
@@ -342,7 +340,7 @@
 
 Each GC core provides a standard interface for interaction with the core.
 
-=head3 Initialization
+=head4 Initialization
 
 Each GC core declares an initialization routine as a function pointer,
 which is installed in F<src/memory.c:mem_setup_allocator()> after
@@ -360,7 +358,7 @@
 
 =back
 
-=head3 Arenas structure function pointers
+=head4 Arenas structure function pointers
 
 Each GC system declares 3 function pointers, stored in the Arenas structure.
 
@@ -443,7 +441,7 @@
 
 =back
 
-=head3 Small_Object_Pool function pointers
+=head4 Small_Object_Pool function pointers
 
 Each GC core defines 4 function pointers stored in the C<Small_Object_Pool>
 structures. These function pointers are used throughout Parrot to implement
@@ -483,7 +481,7 @@
 
 =back
 
-=head3 Write Barrier
+=head4 Write Barrier
 
 Each GC core has to provide the following macros. All of these might be
 defined empty, for GC cores which do not use them.
@@ -505,7 +503,7 @@
 
 =back
 
-=head2 Blocking GC
+=head3 Blocking GC
 
 Being able to block GC is important, so newly allocated Buffers or PMCs won't
 be collected before they're attached to the live tree. Parrot provides locking
@@ -551,9 +549,9 @@
 
 =back
 
-=head2 PMC/Buffer API
+=head3 PMC/Buffer API
 
-=head3 Flags
+=head4 Flags
 
 For PMCs and Buffers to be collected properly, you must set the appropriate
 flags on them. Directly manipulating these flags is not recommended because
@@ -613,15 +611,15 @@
 
 =back
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
 "A unified theory of garbage collection":
 http://portal.acm.org/citation.cfm?id=1028982

Modified: branches/vtable_morph_change/docs/pdds/pdd13_bytecode.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd13_bytecode.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd13_bytecode.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,24 +1,22 @@
 # Copyright (C) 2001-2005, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Parrot Bytecode
 
-docs/pdds/pdd13_bytecode.pod - Parrot Bytecode
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This PDD describes the file format for Parrot Bytecode (PBC) files and the
 interface through which they may be manipulated programatically.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 SYNOPSIS
+=head2 Synopsis
 
 Not applicable.
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 4
 
@@ -40,21 +38,21 @@
 =back
 
 
-=head1 DEFINITIONS
+=head2 Definitions
 
 None.
 
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
-=head2 Changes From The Current Implementation
+=head3 Changes From The Current Implementation
 
 A number of things in this proposed PDD differ from what is currently
 implemented. This section details these changes and some of the reasoning
 behind them.
 
 
-=head3 Packfile Header
+=head4 Packfile Header
 
 The format of the packfile header has changed completely, based upon a
 proposal at
@@ -70,7 +68,7 @@
 be needed in the future.
 
 
-=head3 Segment Header
+=head4 Segment Header
 
 Having the type associated with the segment inside the VM is fine, but since
 it is in the directory segment anyway it seems odd to duplicate it here. Also
@@ -78,14 +76,14 @@
 computable by knowing the size of this header, so it appears redundant).
 
 
-=head3 Fixup Segment
+=head4 Fixup Segment
 
 We need to support unicode sub names, so fixup labels should be an index into
 the constants table to the relevant string instead of just a C string as they
 are now.
 
 
-=head3 Annotations Segment
+=head4 Annotations Segment
 
 This is new and replaces and builds upon the debug segment. See here for some
 on-list discussion:
@@ -93,7 +91,7 @@
 L<http://groups.google.com/group/perl.perl6.internals/browse_thread/thread/b0d36dafb42d96c4/4d6ad2ad2243e677?lnk=gst&rnum=2#4d6ad2ad2243e677>
 
 
-=head3 Packfile PMCs
+=head4 Packfile PMCs
 
 This idea will see packfiles and segments within them being represented by
 PMCs, easing memory management and providing an interface to packfiles for
@@ -107,7 +105,7 @@
 
 
 
-=head2 Packfiles
+=head3 Packfiles
 
 This section of the documentation describes the format of Parrot packfiles.
 These contain the bytecode (sequence of instructions), constants table, fixup
@@ -118,7 +116,7 @@
 The word size is specified in the packfile header.
 
 
-=head3 Packfile Header
+=head4 Packfile Header
 
 PBC files start with a variable length header. All data in this header is
 stored as strings or in a single byte so endianness and word size need not be
@@ -195,7 +193,7 @@
 that is reading the PBC file do not match these, it needs to transform the
 words making up the rest of the packfile.
 
-=head4 Bytecode File Version Numbers
+=head5 Bytecode File Version Numbers
 
 The bytecode file version number exists to decouple the format of the bytecode
 file from the version of the Parrot implementation that is reading/writing it.
@@ -233,7 +231,7 @@
   MAJOR.MINOR DATE NAME DESCRIPTION
 
 
-=head3 Directory Format Header
+=head4 Directory Format Header
 
 Packfiles contain a directory describing the segments that it contains.
 This header specifies the format of the directory.
@@ -257,7 +255,7 @@
 This header must be followed immediately by a directory segment.
 
 
-=head3 Packfile Segment Header
+=head4 Packfile Segment Header
 
 All segments, regardless of type, start with a 1 opcode segment header. All
 other segments below are prefixed with this.
@@ -270,14 +268,14 @@
   +--------+--------+--------------------------------------------------------+
 
 
-=head3 Segment Padding
+=head4 Segment Padding
 
 All segments must have trailing zero (NULL) values appended so they are a
 multiple of 16 bytes in length. (This allows wordsize support of up to
 128 bits.)
 
 
-=head3 Directory Segment
+=head4 Directory Segment
 
 This segment lists the other segments that make up the packfile and where in
 the file they are located. It must occur immediately after the directory
@@ -330,7 +328,7 @@
   +--------+--------+--------------------------------------------------------+
 
 
-=head3 Default Segment
+=head4 Default Segment
 
 The default segment has no additional headers. It will, if possible, be memory
 mapped. More than one may exist in the packfile, and they are identified by
@@ -338,7 +336,7 @@
 segment, for example the source code from a high level language (HLL).
 
 
-=head3 Bytecode Segment
+=head4 Bytecode Segment
 
 This segment has no additonal headers. It stores a stream of instructions in
 bytecode format. Instructions have variable length. Each instruction starts
@@ -380,7 +378,7 @@
   +------------------+-------------------------------------------------------+
 
 
-=head3 Constants Segment
+=head4 Constants Segment
 
 This segment stores number, string and PMC constants. It adds one extra field
 to its header.
@@ -409,12 +407,12 @@
 All constants that are not a multiple of the word size in length must be
 padded with trailing zero bytes up to a word size boundary.
 
-=head4 Number Constants
+=head5 Number Constants
 
 The number is stored in the format defined in the Packfile header. Any padding
 that is needed will follow.
 
-=head4 String Constants
+=head5 String Constants
 
 String constants are stored in the following format, with offsets relative to
 the start of the constant including its type.
@@ -437,13 +435,13 @@
   | 5      | n      | String data with trailing zero padding as required.    |
   +--------+--------+--------------------------------------------------------+
 
-=head4 PMC Constants
+=head5 PMC Constants
 
 PMCs that can be saved in packfiles as constants implement the freeze and thaw
 v-table methods. Their frozen data is placed in a string, stored in the same
 format as a string constant.
 
-=head4 Key Constants
+=head5 Key Constants
 
 Key constants are made up a number of components, where one component is a
 "dimension" in the key. The number of components in the key is stored at the
@@ -480,7 +478,7 @@
 {{ TODO: Figure out slice bits and document them here. }}
 
 
-=head3 Fixup Segment
+=head4 Fixup Segment
 
 The fixup segment maps names of subs to offsets in the bytecode stream. It
 adds one extra field to its header.
@@ -512,7 +510,7 @@
   +--------+--------+--------------------------------------------------------+
 
 
-=head3 PIR Debug Segment
+=head4 PIR Debug Segment
 
 This segment stores the filenames and line numbers of PIR code that was
 compiled to bytecode. The segment comes in two parts.
@@ -552,7 +550,7 @@
 segment.
 
 
-=head3 Annotations Segment
+=head4 Annotations Segment
 
 Annotations allow any instruction in the bytecode stream to have zero or more
 key/value pairs associated with it. These can be retrived at runtime. High
@@ -669,7 +667,7 @@
 the same order as the instructions.
 
 
-=head3 Dependencies Segment
+=head4 Dependencies Segment
 
 This segment holds a table of external and possibly dynamically loaded items
 that are needed for this packfile to run. This includes:
@@ -725,7 +723,7 @@
 
 
 
-=head2 Packfile PMCs
+=head3 Packfile PMCs
 
 A packfile will be represented in memory by Parrot as a tree of PMCs. These
 will provide a programatic way to construct and walk packfiles, both for the
@@ -735,24 +733,24 @@
 consider switching these PMCs over to use them at some point. }}
 
 
-=head3 Packfile.pmc
+=head4 Packfile.pmc
 
 This PMC represents the packfile overall. It will be constructed by the VM
 when reading a packfile. It implements the following methods.
 
-=head4 C<get_string> (v-table)
+=head5 C<get_string> (v-table)
 
 Serializes this packfile data structure into a bytestream ready to be written
 to disk (that is, maps from PMCs to on-disk representation).
 
-=head4 C<set_string_native> (v-table)
+=head5 C<set_string_native> (v-table)
 
 Takes a string containing an entire packfile in the on-disk format, attempts
 to unpack it into a tree of Packfile PMCs and sets this Packfile PMC to
 represent the top of that tree (that is, maps from on-disk representation to a
 tree of PMCs).
 
-=head4 C<get_integer_keyed_str> (v-table)
+=head5 C<get_integer_keyed_str> (v-table)
 
 Used to get data about fields in the header that have an integer value. Valid
 keys are:
@@ -781,7 +779,7 @@
 
 =back
 
-=head4 C<get_string_keyed_str> (v-table)
+=head5 C<get_string_keyed_str> (v-table)
 
 Used to get data about fields in the header that have a string value. Valid
 keys are:
@@ -792,7 +790,7 @@
 
 =back
 
-=head4 C<set_integer_keyed_str> (v-table)
+=head5 C<set_integer_keyed_str> (v-table)
 
 Used to set fields in the packfile header. Some fields are not allowed to be
 written since they are determined by the VM when serializing the packfile for
@@ -819,23 +817,23 @@
 v-table method). Setting an invalid uuid_type value will cause an exception
 to be thrown immediately.
 
-=head4 C<get_directory()>
+=head5 C<get_directory()>
 
 Returns the PackfileDirectory PMC that represents the directory segment at the
 start of the packfile.
 
 
-=head3 PackfileSegment.pmc
+=head4 PackfileSegment.pmc
 
 An abstract PMC that is the base class for all other segments. It has two
 abstract methods, which are to be implemented by all subclasses. They will not
 be listed under the method list for other segment PMCs to save space.
 
-=head4 C<STRING* pack()>
+=head5 C<STRING* pack()>
 
 Packs the segment into the on-disk format and returns a string holding it.
 
-=head4 C<unpack(STRING*)>
+=head5 C<unpack(STRING*)>
 
 Takes the packed representation for a segment of the given type and then
 unpacks it, setting this PMC to represent that segment as a result of the
@@ -843,71 +841,71 @@
 be thrown.
 
 
-=head3 PackfileDirectory.pmc (isa PackfileSegment)
+=head4 PackfileDirectory.pmc (isa PackfileSegment)
 
 This PMC represents a directory segment. Essentially it is an array of
 PackfileSegment PMCs. When indexed using an integer key, it gets the segment
 at that position in the segments table. When indexed using a string key, it
 looks for a segment of that name. It implements the following methods:
 
-=head4 C<elements> (v-table)
+=head5 C<elements> (v-table)
 
 Gets the number of segments listed in the directory.
 
-=head4 C<get_pmc_keyed_int> (v-table)
+=head5 C<get_pmc_keyed_int> (v-table)
 
 Gets a PackfileSegment PMC or an appropriate subclass of it representing the
 segment at the specified index in the directory segment.
 
-=head4 C<get_string_keyed_int> (v-table)
+=head5 C<get_string_keyed_int> (v-table)
 
 Gets a string containing the name of the segment at the specified index in the
 directory segment.
 
-=head4 C<get_pmc_keyed_str> (v-table)
+=head5 C<get_pmc_keyed_str> (v-table)
 
 Searches the directory for a segment with the given name and, if one exists,
 returns a PackfileSegment PMC (or one of its subclasses) representing it.
 
-=head4 C<set_pmc_keyed_str> (v-table)
+=head5 C<set_pmc_keyed_str> (v-table)
 
 Adds a PackfileSegment PMC (or a subclass of it) to the directory with the
 name specified by the key. This is the only way to add another segment to the
 directory. If a segment of the given name already exists in the directory, it
 will be replaced with the supplied PMC.
 
-=head4 C<delete_keyed_str> (v-table)
+=head5 C<delete_keyed_str> (v-table)
 
 Removes the PackfileSegment PMC from the directory which has the name
 specified by the key.  This is the only way to remove a segment from the
 directory.
 
 
-=head3 RawSegment.pmc (isa PackfileSegment)
+=head4 RawSegment.pmc (isa PackfileSegment)
 
 This PMC presents a segment of a packfile as an array of integers. This is the
 lowest possible level of access to a segment, and covers both the default and
 bytecode segment types. It implements the following methods:
 
-=head4 C<get_integer_keyed_int> (v-table)
+=head5 C<get_integer_keyed_int> (v-table)
 
 Reads the integer at the specified offset into the segment, excluding the data
 in the common segment header but including the data making up additional
 fields in the header for a specific type of segment.
 
-=head4 C<set_integer_keyed_int> (v-table)
+=head5 C<set_integer_keyed_int> (v-table)
 
 Stores an integer at the specified offset into the segment. Will throw an
 exception if the segment is memory mapped.
 
-=head4 C<elements> (v-table)
+=head5 C<elements> (v-table)
 
 Gets the length of the segment in words, excluding the length of the common
 segment but including the data making up additional fields in the header for a
 specific type of segment.
 
 
-=head3 PackfileConstantTable.pmc (isa PackfileSegment)
+=head4 PackfileConstantTable.pmc (isa PackfileSegment)
 
 This PMC represents a constants table. It provides access to constants through
 the keyed integer interface (the interpreter may choose to access underlying
@@ -918,50 +916,50 @@
 
 The PMC implements the following methods:
 
-=head4 C<elements> (v-table)
+=head5 C<elements> (v-table)
 
 Gets the number of constants contained in the table.
 
-=head4 C<get_number_keyed_int> (v-table)
+=head5 C<get_number_keyed_int> (v-table)
 
 Gets the value of the number constant at the specified index in the constants
 table. If the constant at that position in the table is not a number, an
 exception will be thrown.
 
-=head4 C<get_string_keyed_int> (v-table)
+=head5 C<get_string_keyed_int> (v-table)
 
 Gets the value of the string constant at the specified index in the constants
 table. If the constant at that position in the table is not a string, an
 exception will be thrown.
 
-=head4 C<get_pmc_keyed_int> (v-table)
+=head5 C<get_pmc_keyed_int> (v-table)
 
 Gets the value of the PMC or key constant at the specified index in the
 constants table. If the constant at that position in the table is not a PMC
 or key, an exception will be thrown.
 
-=head4 C<set_number_keyed_int> (v-table)
+=head5 C<set_number_keyed_int> (v-table)
 
 Sets the value of the number constant at the specified index in the constants
 table. If the constant at that position in the table is not already a number
 constant, an exception will be thrown. If it does not exist, the table will be
 extended.
 
-=head4 C<set_string_keyed_int> (v-table)
+=head5 C<set_string_keyed_int> (v-table)
 
 Sets the value of the string constant at the specified index in the constants
 table. If the constant at that position in the table is not already a string
 constant, an exception will be thrown. If it does not exist, the table will be
 extended.
 
-=head4 C<set_pmc_keyed_int> (v-table)
+=head5 C<set_pmc_keyed_int> (v-table)
 
 Sets the value of the PMC or key constant at the specified index in the
 constants table. If the constant at that position in the table is not already
 a PMC or key constant, an exception will be thrown. If it does not exist, the
 table will be extended.
 
-=head4 C<int get_type(int)>
+=head5 C<int get_type(int)>
 
 Returns an integer value denoting the type of the constant at the specified
 index. Possible values are:
@@ -981,83 +979,83 @@
   +--------+-----------------------------------------------------------------+
 
 
-=head3 PackfileFixupTable.pmc (isa PackfileSegment)
+=head4 PackfileFixupTable.pmc (isa PackfileSegment)
 
 This PMC provides a keyed integer interface to the fixup table. Each entry in
 the table is represented by a PackfileFixupEntry PMC. It implements the
 following methods:
 
-=head4 C<elements> (v-table)
+=head5 C<elements> (v-table)
 
 Gets the number of entries in the fixup table.
 
-=head4 C<get_pmc_keyed_int> (v-table)
+=head5 C<get_pmc_keyed_int> (v-table)
 
 Gets a PackfileFixupEntry PMC for the fixup entry at the position given in
 the key. If the index is out of range, an exception will be thrown.
 
-=head4 C<set_pmc_keyed_int> (v-table)
+=head5 C<set_pmc_keyed_int> (v-table)
 
 Used to add a PackfileFixupEntry PMC to the fixups table or to replace an
 existing one. If the PMC that is supplied is not of type PackfileFixupEntry,
 an exception will thrown.
 
 
-=head3 PackfileFixupEntry.pmc
+=head4 PackfileFixupEntry.pmc
 
 This PMC represents an entry in the fixup table. It implements the following
 methods.
 
-=head4 C<get_string> (v-table)
+=head5 C<get_string> (v-table)
 
 Gets the label field of the fixup entry.
 
-=head4 C<set_string_native> (v-table)
+=head5 C<set_string_native> (v-table)
 
 Sets the label field of the fixup entry.
 
-=head4 C<get_integer> (v-table)
+=head5 C<get_integer> (v-table)
 
 Gets the offset field of the fixup entry.
 
-=head4 C<set_integer_native> (v-table)
+=head5 C<set_integer_native> (v-table)
 
 Sets the offset field of the fixup entry.
 
-=head4 C<int get_type()>
+=head5 C<int get_type()>
 
 Gets the type of the fixup entry. See the entries table for possible fixup
 types.
 
-=head4 C<set_type(int)>
+=head5 C<set_type(int)>
 
 Sets the type of the fixup entry. See the entries table for possible fixup
 types. Specifying an invalid type will result in an exception.
 
 
-=head3 PackfileAnnotations.pmc (isa PackfileSegment)
+=head4 PackfileAnnotations.pmc (isa PackfileSegment)
 
 This PMC represents the bytecode annotations table. The key ID to key name and
 key type mappings are stored in a separate PackfileAnnotationKeys PMC. Each
 (offset, key, value) entry is represented by a PackfileAnnotation PMC. The
 following methods are implemented:
 
-=head4 C<PMC* get_key_list()>
+=head5 C<PMC* get_key_list()>
 
 Returns a PackfileAnnotationKeys PMC containing the names and types of the
 annotation keys. Fetch and add to this to create a new annotation key.
 
-=head4 C<elements> (v-table)
+=head5 C<elements> (v-table)
 
 Gets the number of annotations in the table.
 
-=head4 C<get_pmc_keyed_int> (v-table)
+=head5 C<get_pmc_keyed_int> (v-table)
 
 Gets the annotation at the specified index. If there is no annotation at that
 index, an exception will be thrown. The PMC that is returned will always be a
 PackfileAnnotation PMC.
 
-=head4 C<set_pmc_keyed_int> (v-table)
+=head5 C<set_pmc_keyed_int> (v-table)
 
 Sets the annotation at the specified index. If there is no annotation at that
 index, it is added to the list of annotations. An exception will be thrown
@@ -1078,82 +1076,82 @@
 =back
 
 
-=head3 PackfileAnnotationKeys.pmc
+=head4 PackfileAnnotationKeys.pmc
 
 This PMC represents the table of keys and the type of value that is stored
 against that key. It implements the following methods:
 
-=head4 C<get_string_keyed_int> (v-table)
+=head5 C<get_string_keyed_int> (v-table)
 
 Gets the name of the annotation key specified by the index. An exception will
 be thrown if the index is out of range.
 
-=head4 C<set_string_keyed_int> (v-table)
+=head5 C<set_string_keyed_int> (v-table)
 
 Sets the name of the annotation key specified by the index. If there is no key
 with that index currently, a key at that position in the table will be added.
 
-=head4 C<get_integer_keyed_int> (v-table)
+=head5 C<get_integer_keyed_int> (v-table)
 
 Gets an integer representing the type of the value that is stored with the key
 at the specified index. An exception will be thrown if the index is out of
 range.
 
-=head4 C<set_integer_keyed_int> (v-table)
+=head5 C<set_integer_keyed_int> (v-table)
 
 Sets the type of the value that is stored with the key at the specified index.
 If there is no key with that index currently, a key at that position in the
 table will be added.
 
 
-=head3 PackfileAnnotation.pmc
+=head4 PackfileAnnotation.pmc
 
 This PMC represents an individual bytecode annotation entry in the annotations
 segment. It implements the following methods:
 
-=head4 C<int get_offset()>
+=head5 C<int get_offset()>
 
 Gets the offset into the bytecode of the instruction that is being annotated.
 
-=head4 C<set_offset(int)>
+=head5 C<set_offset(int)>
 
 Sets the offset into the bytecode of the instruction that is being annotated.
 
-=head4 C<int get_key_id()>
+=head5 C<int get_key_id()>
 
 Gets the ID of the key of the annotation.
 
-=head4 C<int set_key_id()>
+=head5 C<int set_key_id()>
 
 Sets the ID of the key of the annotation.
 
-=head4 C<get_integer> (v-table)
+=head5 C<get_integer> (v-table)
 
 Gets the value of the annotation. This may be, depending upon the type of the
 annotation, an integer annotation or an index into the constants table.
 
-=head4 C<set_integer> (v-table)
+=head5 C<set_integer> (v-table)
 
 Sets the value of the annotation. This may be, depending upon the type of the
 annotation, an integer annotation or an index into the constants table.
 
 
-=head1 LANGUAGE NOTES
+=head2 Language Notes
 
 None.
 
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
 
-=head1 REFERENCES
+=head2 References
 
 None.
 

Modified: branches/vtable_morph_change/docs/pdds/pdd15_objects.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd15_objects.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd15_objects.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,31 +1,29 @@
 # Copyright (C) 2001-2007, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Objects and Classes
 
-docs/pdds/pdd15_objects.pod - Object and Class semantics for Parrot
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This PDD describes the semantics of Parrot's object and class systems.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DEFINITIONS
+=head2 Definitions
 
-=head2 Object
+=head3 Object
 
 An object is a value that incorporates both data and behavior
 related to that data.
 
-=head2 Class
+=head3 Class
 
 A class defines a pattern of characteristics and behaviors from which
 objects are constructed.
 
-=head2 Attribute
+=head3 Attribute
 
 An attribute is a slot in an object that contains a value, generally a
 PMC. Attributes are referenced by class name/attribute name pairs.
@@ -37,35 +35,35 @@
 features in HLLs, attributes are not accessible via fixed attribute
 offsets, but only via named lookup.
 
-=head2 Method
+=head3 Method
 
 A method is a piece of code that you invoke by name through an object.
 Methods implement the behaviour of an object.
 
-=head2 Parent class
+=head3 Parent class
 
 Also called the super-class. The parent class is, in an inheritance situation,
 the class being derived from. If A derives from B, B is the parent class of A.
 
-=head2 Child class
+=head3 Child class
 
 Also called the sub-class. The child class is, in an inheritance situation,
 the class doing the deriving. If A derives from B, A is the child class.
 
-=head2 Role
+=head3 Role
 
 A role adds attributes and methods into a class without inheritance. The
 composed class retains a list of roles applied to it (so they can be
 checked with C<does>), but otherwise maintains no distinction between
 composed attributes and methods and those defined in the class.
 
-=head2 Delegate
+=head3 Delegate
 
 An object that is transparently (to the user) embedded in another object.
 Delegate objects are used in those cases where we can't inherit from a class
 because the class is from a different object universe.
 
-=head2 Property
+=head3 Property
 
 A property is a role that only adds attributes and accessors.
 
@@ -73,11 +71,11 @@
 may not exist on a PMC at any particular time. Properties are not restricted
 to objects as such--any PMC may have a property attached to it.
 
-=head2 Interface
+=head3 Interface
 
 An interface is a role that only adds methods.
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 4
 
@@ -131,7 +129,7 @@
 
 =back
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 There are four pieces to the object implementation. There are the PMCs for the
 classes, roles, and objects, the opcodes the engine uses to do objecty things,
@@ -148,7 +146,7 @@
 class, but currently it doesn't.)
 
 
-=head2 Class PMC API
+=head3 Class PMC API
 
 There are two PMC classes, C<Class> and C<Object>.  Class PMCs hold all
 the class-specific information. Instantiating a new OO class creates a
@@ -255,7 +253,7 @@
 
 Class PMCs also have the "I am a class" flag set on them.
 
-=head3 Classes, Namespaces, and the Class Registry
+=head4 Classes, Namespaces, and the Class Registry
 
 Extending an existing class that has been instantiated creates a new
 class object that replaces the old class object in the Namespace.
@@ -291,7 +289,7 @@
 class is garbage collected, it should remove itself from the registry.
 
 
-=head3 Class Vtable Entries
+=head4 Class Vtable Entries
 
 To make this work all Classes need the following vtable entries.
 
@@ -411,7 +409,7 @@
 Class classes. This is a restriction which will be lifted at some point
 soon.
 
-=head3 Class Methods
+=head4 Class Methods
 
 These methods are just syntactic sugar for the vtable functions. They are
 not included in the Class PMC by default, but added to Class as a role.
@@ -557,7 +555,7 @@
 
 =back
 
-=head2 Object PMC API
+=head3 Object PMC API
 
 C<Object> PMCs are the actual objects, and hold all the per-object
 instance data.
@@ -612,7 +610,7 @@
   o1.foo(); # calls B's method
   o2.foo(); # calls B's method
 
-=head3 Object Vtable Entries
+=head4 Object Vtable Entries
 
 All Objects need the following vtable entries.
 
@@ -689,7 +687,7 @@
 
 =back
 
-=head2 Role PMC API
+=head3 Role PMC API
 
 An instance of the Role PMC has five attributes, which are:
 
@@ -720,7 +718,7 @@
 
 =back
 
-=head3 Role Vtable Entries
+=head4 Role Vtable Entries
 
 All Roles need the following vtable entries.
 
@@ -791,7 +789,7 @@
 
 =back
 
-=head3 Role Methods
+=head4 Role Methods
 
 These methods are just syntactic sugar for the vtable functions. They are
 not included in the Role PMC by default, but added to Role as a role.
@@ -880,7 +878,7 @@
 
 =back
 
-=head3 Role Conflict Resolution
+=head4 Role Conflict Resolution
 
 When a role is added to a class, we try to compose it right away, and
 throw an exception on any conflicts that are detected. A conflict occurs
@@ -925,7 +923,7 @@
 in the class. Any attempt to combine a multi with a non-multi will
 result in an error.
 
-=head2 Opcodes
+=head3 Opcodes
 
 The following ops are provided to deal with objects. Please note that
 method calls are governed by Parrot's calling conventions, and as such
@@ -1124,7 +1122,7 @@
 
 =back
 
-=head2 PIR Class Definitions
+=head3 PIR Class Definitions
 
 PIR provides some syntactic sugar for declaring classes.
 
@@ -1155,7 +1153,7 @@
 are compiled, the methods and vtable overrides are temporarily stored in the
 associated namespace.
 
-=head2 Vtable Overriding
+=head3 Vtable Overriding
 
 Classes may override the vtable functions, allowing objects of a class to
 behave like a primitive PMC. To use these properly at a low-level
@@ -1168,7 +1166,7 @@
 declaration of the method, or pass a named parameter "vtable" into the
 C<add_method> method on a class or role.
 
-=head2 What The Bytecode Sees
+=head3 What The Bytecode Sees
 
 The bytecode is isolated from most of the internal details of the
 implementation. This allows both for flexibility in the implementation and
@@ -1180,18 +1178,18 @@
 
 
 
-=head1 EXAMPLES
+=head2 Examples
 
 The following examples all assume we're working with basic Object objects
 and Class classes.
 
-=head2 Creating a new class
+=head3 Creating a new class
 
 To create a new class C<Foo> which has no parent classes:
 
    newclass $P0, "Foo"
 
-=head2 Creating a new class with multiple parents
+=head3 Creating a new class with multiple parents
 
 To create a class C<Foo> with the parents C<A> and C<B>, the code would be:
 
@@ -1200,7 +1198,7 @@
    subclass $P2, $P0, "Foo"
    addparent $P2, $P1
 
-=head2 Creating a new class with attributes
+=head3 Creating a new class with attributes
 
 Adding the attributes C<a> and C<b> to the new class C<Foo>:
 
@@ -1208,7 +1206,7 @@
   addattribute $P0, "a"
   addattribute $P0, "b"
 
-=head2 Instantiating an object
+=head3 Instantiating an object
 
 Assuming we want an object of class C<Foo>:
 
@@ -1217,7 +1215,7 @@
   FooClass = get_class "Foo"
   MyObject = FooClass.new()
 
-=head2 Calling a method on an object
+=head3 Calling a method on an object
 
 Calling the method C<Xyzzy> on an object, assuming the PDD03 calling
 conventions are respected:
@@ -1234,13 +1232,13 @@
   set S0, "Xyzzy"
   callmethodcc
 
-=head2 Accessing attributes from within a class
+=head3 Accessing attributes from within a class
 
 With named access:
 
   getattribute $P1, $P0, "Foo\x0b"
 
-=head1 Explanations
+=head2 Explanations
 
 To get a new class, you can do a C<newclass>, which creates a new class
 with no parents besides Parrot's default super-ish parent class.
@@ -1262,11 +1260,11 @@
 first class in the immediate parent list then use the C<addparent> op to add
 in the rest of the immediate parents.
 
-=head1 LANGUAGE NOTES
+=head2 Language Notes
 
 Notes on some of the OO-related needs of various languages.
 
-=head2 PMCs
+=head3 PMCs
 
 Ruby: Just like Smalltalk, everything is an object.  I'm hoping to be able to
 implement core Ruby classes (String, Array, Hash, Module, etc)  something like
@@ -1279,13 +1277,13 @@
      \      /
     RubyString
 
-=head2 Objectspace
+=head3 Objectspace
 
 Ruby: Objectspace in Ruby allows the programmer to iterate through every live
 object in the system.  There is some debate about how to make this play nice
 with different garbage collection schemes.
 
-=head2 Classes
+=head3 Classes
 
 A class is a collection of methods and attributes. It would be desirable, for
 those classes whose definition is fully known at compile time, to have a
@@ -1293,12 +1291,12 @@
 into a PBC file rather than created at runtime. However, creation of new
 classes at runtime will be needed too.
 
-=head2 Meta-classes
+=head3 Meta-classes
 
 Ruby: Ruby has meta-classes.  It would be nice if classes were objects in
 Parrot's OO model.
 
-=head2 Attributes
+=head3 Attributes
 
 Attributes are instance data associated with a class (or role, however those
 are supported). They may not always be of a type specified by a PMC, though
@@ -1318,7 +1316,7 @@
 
 Ruby: Attributes can be dynamically added and removed at runtime.
 
-=head2 Methods
+=head3 Methods
 
 Perl 6: Methods may be public (anyone can invoke them) or private (only
 invokable by the class they are defined in). Additionally, submethods are
@@ -1329,7 +1327,7 @@
 Ruby: has a method_missing that gets called when method resolution fails to
 find a method.  Methods can be dynamically added and removed at runtime.
 
-=head2 Constructors
+=head3 Constructors
 
 A constructor is run when an object is instantiated.
 
@@ -1337,7 +1335,7 @@
 different signatures), and the correct one is called based upon the passed
 parameters.
 
-=head2 Inheritance
+=head3 Inheritance
 
 Perl 6: Multiple inheritance.
 
@@ -1345,7 +1343,7 @@
 
 Ruby: Single inheritance but support for mixins of Ruby modules.
 
-=head2 Interfaces
+=head3 Interfaces
 
 An interface specifies a set of methods that must be implemented by a class
 that inherits (or implements) the interface, but does not provide any form of
@@ -1354,7 +1352,7 @@
 .Net: Interfaces are pretty much what was just describe above. XXX Need to
 check behavior of you implement two interfaces with methods of the same name.
 
-=head2 Roles
+=head3 Roles
 
 A role consists of a set of methods and attributes. It cannot be instantiated
 on its own, but must be composed into a class. When this happens its methods
@@ -1371,7 +1369,7 @@
 detection? For compile time composition that's easy to punt to the compiler;
 for runtime composition, that's not so easy though.
 
-=head2 Introspection (aka Reflection)
+=head3 Introspection (aka Reflection)
 
 Perl 6: Reflection provides access to a list of methods that a class has, its
 parent classes and the roles it does, as well as the name of the class and its
@@ -1382,7 +1380,7 @@
 as the name of the class and its parent. The types of attributes and
 signatures of methods are also available.
 
-=head2 Inner Classes
+=head3 Inner Classes
 
 An inner class is essentially a class defined within a class. Therefore it has
 access to things private to its outer class.
@@ -1392,7 +1390,7 @@
 .Net: Inner classes are allowed and may be private, public, protected or
 internal.
 
-=head2 Delegation
+=head3 Delegation
 
 Delegation is where a method call is "forwarded" to another class. Parrot may
 provide support for simple cases of it directly, or could just provide a "no
@@ -1402,7 +1400,7 @@
 Perl 6: Delegation support is highly flexible, even allowing a regex to match
 method names that should be delegated to a particular object.
 
-=head2 Prototype-based OO
+=head3 Prototype-based OO
 
 Prototype-based OO has no classes. All objects are cloned from existing
 objects and modified. Requires lightweight singleton creation, without
@@ -1414,7 +1412,7 @@
   Dog bark := method("yap" print) # It has a method 'bark'
   Dog bark  # call the method 'bark', printing 'yap'
 
-=head2 Translation
+=head3 Translation
 
 The following list a set of languages, then within each language what the
 Parrot term translates to.
@@ -1457,15 +1455,15 @@
 
 =back
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
   docs/pdds/pdd15_object_metamodel.png
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
 None.
 

Modified: branches/vtable_morph_change/docs/pdds/pdd17_pmc.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd17_pmc.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd17_pmc.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,33 +1,29 @@
-# Copyright (C) 2001-2008, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Polymorphic Containers
 
-docs/pdds/pdd17_pmc.pod - Parrot Magic Cookies
-
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 ABSTRACT
+=head2 Abstract
 
-This PDD describes the internal structure and behavior of the Parrot Magic
-Cookie (PMC) data type.
+This PDD describes the internal structure and behavior of the Polymorphic
+Container (PMC) data type.
 
-=head1 DESCRIPTION
+=head2 Description
 
 PMCs implement all internal data types more complex than a simple integer,
 float, or string, and also the data types of high-level languages.  Nothing
 outside the core of Parrot (in fact, nothing outside the data type's vtable
-routines) should infer anything about a PMC (hence the Magic part).
+routines) should infer anything about a PMC.
 
 This does mean, though, that you need to either know what functions are
 available and what they do, or have some method of finding out. Parrot defines
 a standard set of functions that each PMC provides. More complex features are
 constructed out of these fundamental building blocks.
 
-=head1 DESCRIPTION
-
 =over 4
 
 =item - PMCs contain both state and behavior
@@ -41,9 +37,9 @@
 
 =back
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
-=head2 Internal structure
+=head3 Internal structure
 
 All PMCs have the form:
 
@@ -116,7 +112,7 @@
 more) types of PMC, while particular Python datatypes will map onto different
 types of PMC.
 
-=head2 Defining PMCs
+=head3 Defining PMCs
 
 PMCs are declared by the C<pmclass> keyword:
 
@@ -221,7 +217,7 @@
 
 =back
 
-=head3 Defining attributes
+=head4 Defining attributes
 
 The attributes of a PMC (both public and private) live in a custom
 struct for the PMC, stored in the C<data> member of the C<PMC> struct.
@@ -259,7 +255,7 @@
 members in the child PMC, define the parents as roles instead of classes, or
 declare the multiply inheriting child in PIR or an HLL.
 
-=head3 Defining vtable functions
+=head4 Defining vtable functions
 
 Vtable functions are defined as C functions within the body of the C<pmclass>
 declaration, and are marked with C<VTABLE>.
@@ -295,14 +291,14 @@
 
 =back
 
-=head3 Methods
+=head4 Methods
 
 Methods are declared in the body of the C<pmclass> or C<prole>
 declaration with C<METHOD>.
 
   METHOD inspect(STRING *what :optional, int got_what :opt_flag) {...}
 
-=head2 PMCs and Namespaces
+=head3 PMCs and Namespaces
 
 Like high-level classes, low-level PMCs are tied to a corresponding
 namespace. By default this is a namespace with the same name as the PMC
@@ -320,7 +316,7 @@
 HLLs can choose to provide direct access to Parrot's core PMC types by
 aliasing them within the HLL namespace.
 
-=head2 Inheritance
+=head3 Inheritance
 
 PMCs can inherit behavior and state from other PMCs. Inheritance is performed
 in the C<pmclass> declaration using the C<extends> keyword.
@@ -328,7 +324,7 @@
   pmclass Foo extends Bar {
   }
 
-=head2 Composition
+=head3 Composition
 
 Composition is another form of code reuse in PMCs. Unlike inheritance,
 composed roles aren't complete stand-alone PMCs, they are just bundles of
@@ -360,7 +356,7 @@
 
 Roles are composed into a PMC with the C<does> modifier.
 
-=head2 PMCs and high-level objects
+=head3 PMCs and high-level objects
 
 High-level objects, as specified in PDD15, need to be able to inherit
 from PMCs. Subclassing a low-level PMC from a high-level class makes an
@@ -433,9 +429,9 @@
 interface.
 
 
-=head1 REFERENCE
+=head2 Definitions
 
-=head2 Vtable Functions
+=head3 Vtable Functions
 
 Vtables decouple the interface and implementation of various object functions.
 The actual vtable structure contains pointers to functions that implement the
@@ -448,7 +444,7 @@
 The following list details each of the vtable functions, their prototypes, and
 their behavior.
 
-=head3 Core Vtable Functions
+=head4 Core Vtable Functions
 
 =over 4
 
@@ -614,7 +610,7 @@
 
 =back
 
-=head3 Accessors
+=head4 Accessors
 
 =over 4
 
@@ -808,7 +804,7 @@
 
 =back
 
-=head3 Aggregate Vtable Functions
+=head4 Aggregate Vtable Functions
 
 Many of the following functions have a *_keyed form, a *_keyed_int form, and a
 *_keyed_str form. The keyed forms take a PMC *, INTVAL, or STRING * key as a
@@ -1065,7 +1061,7 @@
 
 =back
 
-=head3 Math Vtable Functions
+=head4 Math Vtable Functions
 
 =over 4
 
@@ -1228,7 +1224,7 @@
 
 =back
 
-=head3 Logical Vtable Functions
+=head4 Logical Vtable Functions
 
 =over 4
 
@@ -1422,7 +1418,7 @@
 
 =back
 
-=head3 String Vtable Functions
+=head4 String Vtable Functions
 
 =over 4
 
@@ -1458,7 +1454,7 @@
 
 =back
 
-=head3 Code Vtable Functions
+=head4 Code Vtable Functions
 
 =over 4
 
@@ -1470,7 +1466,7 @@
 
 =back
 
-=head3 Class/Object Vtable Functions
+=head4 Class/Object Vtable Functions
 
 =over 4
 
@@ -1588,13 +1584,13 @@
 
 
 
-=head2 Core PMCs
+=head3 Core PMCs
 
 Parrot has a number of core PMC types that all programs can guarantee will be
 available to them. (With the possible exception of Parrot programs executing
 on an embedded device or other restricted environment)
 
-=head3 Scalar types
+=head4 Scalar types
 
 =over 4
 
@@ -1716,7 +1712,7 @@
 
 =back
 
-=head3 Array types
+=head4 Array types
 
 Note that for the following types you can set the size of the array by using
 the VTABLE_set_integer_native() method. Assigning an integer to the array as a
@@ -1781,7 +1777,7 @@
 
 =back
 
-=head3 Hash types
+=head4 Hash types
 
 =over 4
 
@@ -1821,7 +1817,7 @@
 
 =back
 
-=head3 Subroutine types
+=head4 Subroutine types
 
 =over 4
 
@@ -1872,15 +1868,15 @@
 
 =back
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
   docs/pmc2c.pod
 

Modified: branches/vtable_morph_change/docs/pdds/pdd18_security.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd18_security.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd18_security.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,16 +1,17 @@
-=head1 NAME
+# Copyright (C) 2007-2008, The Perl Foundation.
+# $Id$
 
-docs/pdds/pdd18_security.pod - Security Model
+=head1 Security Model
 
-=head1 ABSTRACT
+=head2 Abstract
 
 This PDD describes the security infrastructure of Parrot.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DESCRIPTION
+=head2 Description
 
 Parrot will be used in a variety of different application contexts, each with
 its own unique security needs.
@@ -40,13 +41,13 @@
 
 =back
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 Parrot's security infrastructure is not an independent, encapsulated
 subsystem.  It is a series of related features and functionality spread
 throughout the virtual machine.
 
-=head2 Resource Quotas
+=head3 Resource Quotas
 
 Resource quotas ensure that an interpreter doesn't use more CPU time, memory,
 or system resources than are allowed. Quotas are most useful when running code
@@ -56,7 +57,7 @@
 quotas, the I/O system handles file open and pending I/O count quotas, and so
 on.
 
-=head2 Privileges
+=head3 Privileges
 
 A privilege system is used to restrict code from performing certain
 actions. When privilege checking is in force the code may need a particular
@@ -108,7 +109,7 @@
 
 =back
 
-=head3 Users
+=head4 Users
 
 For the most part, a "user" in the Parrot privilege system doesn't correspond
 to a literal user (though it may, if Parrot is running embedded in a database
@@ -117,7 +118,7 @@
 can be cheaply passed around, and validated whenever a restricted action is
 performed.
 
-=head3 Opcode Disabling
+=head4 Opcode Disabling
 
 All opcodes in Parrot can be selectively disabled, by short name (C<print>),
 long name (including signature, C<print_sc>), or by group (C<io>, C<net>,
@@ -135,7 +136,7 @@
       ...
   }
 
-=head3 Library Loading
+=head4 Library Loading
 
 In certain environments, it's desirable to be able to restrict what libraries
 may be loaded by code running on the virtual machine. The allowed library list
@@ -152,14 +153,14 @@
 environment with library loading restrictions turned on means you always know
 exactly what dependencies the code base has.
 
-=head3 Resource Access
+=head4 Resource Access
 
 Access to resources such as the local disk, network, are controlled through
 the privilege system. Resource access limitations are a combination of
 disabled opcodes, blocked library loading, and privilege checks within
 standard libraries for I/O, network, etc.
 
-=head2 Sandboxing
+=head3 Sandboxing
 
 A sandbox is a virtual machine within the virtual machine. It's a safe zone to
 contain code from an untrusted source. In the extreme case, a sandbox is
@@ -171,7 +172,7 @@
 together with the privileges system, in that by default code in the sandbox
 has no privileges outside the sandbox, but may be granted privileges.
 
-=head2 Data Firewall
+=head3 Data Firewall
 
 Any data that originates from user input (command-line, user prompt, web form,
 file access, network operation) is a potential security risk. The best place
@@ -192,7 +193,7 @@
 The same filter rules applied within the data firewall can be called
 explicitly on any data.
 
-=head2 Bytecode Validation
+=head3 Bytecode Validation
 
 In normal operation the interpreter assumes that the bytecode that it executes
 is valid -- that is, any parameters to opcodes are sane, data structures are
@@ -201,7 +202,7 @@
 sure that all specified register numbers are within valid range, and string
 and PMC structures used are valid.
 
-=head2 Auditing Hooks
+=head3 Auditing Hooks
 
 Even in dynamic languages, it's possible to perform a degree of static
 analysis for security risks. The opcode syntax tree (OST) produced by the
@@ -216,13 +217,13 @@
 form is standard across high-level languages running on Parrot, the tools can
 be written once and applied to many languages.
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 
-=head1 REFERENCES
+=head2 References
 
 "Exploring the Broken Web": http://talks.php.net/show/osdc07
 

Modified: branches/vtable_morph_change/docs/pdds/pdd19_pir.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd19_pir.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd19_pir.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,32 +1,30 @@
 # Copyright (C) 2007, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Parrot Intermediate Representation
 
-docs/pdds/pdd19_pir.pod - Parrot Intermediate Representation
-
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
 
-=head1 ABSTRACT
+=head2 Abstract
 
 This document outlines the architecture and core syntax of Parrot
 Intermediate Representation (PIR).
 
-=head1 DESCRIPTION
+=head2 Description
 
 PIR is a stable, middle-level language intended both as a target for the
 generated output from high-level language compilers, and for human use
 developing core features and extensions for Parrot.
 
-=head2 Basic Syntax
+=head3 Basic Syntax
 
 A valid PIR program consists of a sequence of statements, directives, comments
 and empty lines.
 
-=head3 Statements
+=head4 Statements
 
 A statement starts with an optional label, contains an instruction, and is
 terminated by a newline (<NL>). Each statement must be on its own line.
@@ -37,18 +35,18 @@
 operation, such as a subroutine call, a method call, a directive, or PIR
 syntactic sugar.
 
-=head3 Directives
+=head4 Directives
 
 A directive provides information for the PIR compiler that is outside the
 normal flow of executable statements. Directives are all prefixed with a ".",
 as in C<.local> or C<.sub>.
 
-=head3 Comments
+=head4 Comments
 
 Comments start with C<#> and last until the following newline. PIR also allows
 comments in Pod format. Comments, Pod content, and empty lines are ignored.
 
-=head3 Identifiers
+=head4 Identifiers
 
 Identifiers start with a letter or underscore, then may contain additionally
 letters, digits, and underscores. Identifiers don't have any limit on length
@@ -77,7 +75,7 @@
  goto      if       int         null
  num       pmc      string      unless
 
-=head3 Labels
+=head4 Labels
 
 A label declaration consists of a label name followed by a colon. A label name
 conforms to the standard requirements for identifiers. A label declaration may
@@ -95,7 +93,7 @@
      ...
   label1:
 
-=head3 Registers and Variables
+=head4 Registers and Variables
 
 There are two ways of referencing Parrot's registers. The first is
 through named local variables declared with C<.local>.
@@ -113,7 +111,7 @@
 register in the register set, C<$P42> may be stored in the zeroth PMC
 register, if it is the only register in the subroutine.
 
-=head2 Constants
+=head3 Constants
 
 Constants may be used in place of registers or variables. A constant is not
 allowed on the left side of an assignment, or in any other context where the
@@ -178,7 +176,7 @@
 
 =back
 
-=head2 String escape sequences
+=head3 String escape sequences
 
 Inside double-quoted strings the following escape sequences are processed.
 
@@ -213,7 +211,7 @@
 
 =back
 
-=head2 Directives
+=head3 Directives
 
 =over 4
 
@@ -389,7 +387,7 @@
 
 =back
 
-=head3 Subroutine flags
+=head4 Subroutine flags
 
 =over 4
 
@@ -539,7 +537,7 @@
 =back
 
 
-=head3 Directives used for Parrot calling conventions.
+=head4 Directives used for Parrot calling conventions.
 
 =over 4
 
@@ -604,7 +602,7 @@
 
 =back
 
-=head3 Directives for subroutine parameters
+=head4 Directives for subroutine parameters
 
 =over 4
 
@@ -617,7 +615,7 @@
 
 =back
 
-=head3 Parameter Passing and Getting Flags
+=head4 Parameter Passing and Getting Flags
 
 See L<PDD03|pdds/pdd03_calling_conventions.pod> for a description of
 the meaning of the flag bits C<SLURPY>, C<OPTIONAL>, C<OPT_FLAG>,
@@ -625,7 +623,7 @@
 C<:slurpy>, C<:optional>, C<:opt_flag>, and C<:flat>.
 
 
-=head3 Catching Exceptions
+=head4 Catching Exceptions
 
 Using the C<push_eh> op you can install an exception handler. If an exception
 is thrown, Parrot will execute the installed exception handler. In order to
@@ -657,7 +655,7 @@
 See L<PDD23|pdds/pdd23_exceptions.pod> for accessing the various attributes
 of the exception object.
 
-=head2 Syntactic Sugar
+=head3 Syntactic Sugar
 
 Any PASM opcode is a valid PIR instruction. In addition, PIR defines some
 syntactic shortcuts. These are provided for ease of use by humans producing
@@ -807,7 +805,7 @@
 
 =back
 
-=head2 Assignment and Morphing
+=head3 Assignment and Morphing
 
 The C<=> syntactic sugar in PIR, when used in the simple case of:
 
@@ -828,7 +826,7 @@
 For assign to value semantics for two PMC arguments use C<assign>, which calls
 the C<assign_pmc> vtable function.
 
-=head2 Macros
+=head3 Macros
 
 This section describes the macro layer of the PIR language. The macro layer of
 the PIR compiler handles the following directives:
@@ -893,7 +891,7 @@
 substitution of a C<.macro_const> contains no newlines, so it can be used
 within a line of code.
 
-=head3 Macro parameter list
+=head4 Macro parameter list
 
 The parameter list for a macro is specified in parentheses after the name of
 the macro. Macro parameters are not typed.
@@ -979,7 +977,7 @@
 
 =back
 
-=head3 Unique local labels
+=head4 Unique local labels
 
 Within the macro body, the user can declare a unique label identifier using
 the value of a macro parameter, like so:
@@ -991,7 +989,7 @@
   .endm
 
 
-=head3 Unique local variables
+=head4 Unique local variables
 
 B<Note: this is not yet implemented in IMCC>.
 
@@ -1065,7 +1063,7 @@
 means that multiple expansions of a macro will not result in conflicting
 label or local names.
 
-=head3 Ordinary local variables
+=head4 Ordinary local variables
 
 Defining a non-unique variable can still be done, using the normal syntax:
 
@@ -1098,9 +1096,9 @@
 twice.  If you intend the macro to create unique variables names, use
 C<.macro_local> instead of C<.local> to take advantage of the name munging.
 
-=head1 EXAMPLES
+=head2 Examples
 
-=head2 Subroutine Definition
+=head3 Subroutine Definition
 
 A simple subroutine, marked with C<:main>, indicating it's the entry point
 in the file. Other sub flags include C<:load>, C<:init>, etc.
@@ -1116,7 +1114,7 @@
 
     .end
 
-=head2 Subroutine Call
+=head3 Subroutine Call
 
 Invocation of a subroutine. In this case a continuation subroutine is
 created.
@@ -1138,7 +1136,7 @@
       .get_result r
     .end_call
 
-=head2 NCI Call
+=head3 NCI Call
 
     load_lib $P0, "libname"
     dlfunc $P1, $P0, "funcname", "signature"
@@ -1152,7 +1150,7 @@
       .get_result r
     .end_call
 
-=head2 Subroutine Call Syntactic Sugar
+=head3 Subroutine Call Syntactic Sugar
 
 Below there are three different ways to invoke the subroutine C<sub_label>.
 The first retrieves a single return value, the second retrieves 3 return
@@ -1172,7 +1170,7 @@
    $P0(args)
 
 
-=head2 Methods
+=head3 Methods
 
   .namespace [ "Foo" ]
 
@@ -1192,7 +1190,7 @@
 The variable "self" automatically refers to the invocating object, if the
 subroutine declaration contains "method".
 
-=head2 Calling Methods
+=head3 Calling Methods
 
 The syntax is very similar to subroutine calls. The call is done with
 C<.meth_call> which must immediately be preceded by the C<.invocant>:
@@ -1215,7 +1213,7 @@
 The return continuation is optional. The method can be a string
 constant or a string variable.
 
-=head2 Returning and Yielding
+=head3 Returning and Yielding
 
   .return ( a, b )      # return the values of a and b
 
@@ -1232,7 +1230,7 @@
   .yield ()            # yield with no value
 
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 There are multiple implementations of PIR, each of which will meet this
 specification for the syntax. Currently there are the following
@@ -1259,15 +1257,15 @@
 =back
 
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 N/A
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 N/A
 
-=head1 REFERENCES
+=head2 References
 
 N/A
 

Modified: branches/vtable_morph_change/docs/pdds/pdd20_lexical_vars.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd20_lexical_vars.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd20_lexical_vars.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,20 +1,18 @@
 # Copyright (C) 2001-2006, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Lexical Variables
 
-docs/pdds/pdd20_lexical_vars.pod - Lexical variables
-
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 ABSTRACT
+=head2 Abstract
 
 This document defines the requirements and implementation strategy for
 lexically scoped variables.
 
-=head1 SYNOPSIS
+=head2 Synopsis
 
     .sub foo
         .lex "$a", P0
@@ -53,15 +51,15 @@
         P0 = find_lex "x"   # SUCCEEDS
     .end
 
-=head1 DESCRIPTION
+=head2 Description
 
 For Parrot purposes, "lexical variables" are variables stored in a
 hash (or hash-like) PMC associated with a subroutine invocation,
 a.k.a. a call frame.
 
-=head2 Conceptual Model
+=head3 Conceptual Model
 
-=head3 LexInfo PMC
+=head4 LexInfo PMC
 
 LexInfo PMCs contain what is known at compile time about lexical variables of
 a given subroutine: their names (for most languages), perhaps their types,
@@ -73,7 +71,7 @@
 HLL-mapped type LexInfo.  (Note that this type may actually be Null in some
 HLLs, e.g. Tcl.)
 
-=head3 LexPad PMC
+=head4 LexPad PMC
 
 LexPads hold what becomes known at run time about lexical variables of a given
 invocation of a given subroutine: their values, of course, and for some
@@ -103,7 +101,7 @@
 TODO: Describe how lexical naming system interacts with non-ASCII character
       sets.
 
-=head3 Lexical Lookup Algorithm
+=head4 Lexical Lookup Algorithm
 
 If Parrot is asked to access a lexical variable named $var, Parrot
 follows the following strategy.  Note that fetch and store use the
@@ -125,7 +123,7 @@
   4. Set $sub to $sub.outer.  (That is, the textually enclosing subroutine.)
      But if $sub has no outer sub, REPORT FAILURE.
 
-=head3 LexPad and LexInfo are optional; the ":lex" attribute
+=head4 LexPad and LexInfo are optional; the ":lex" attribute
 
 Parrot does not assume that every subroutine needs lexical variables.
 Therefore, Parrot defaults to I<not> creating LexInfo or LexPad PMCs.  It only
@@ -139,7 +137,7 @@
 languages, the additional Subroutine attribute ":lex" should be specified.  It
 forces Parrot to create LexInfo and LexPads.
 
-=head3 Closures
+=head4 Closures
 
 NOTE: This section should be taken using the "as-if" rule: Parrot behaves as
 if this section were literally true.  As always, short cuts (development and
@@ -151,7 +149,7 @@
 variables.  Its implementation may be as simple as a basic PMC array, but any
 ordered integer-indexed collection will do.
 
-=head3 Closure creation: Capturing the lexical environment
+=head4 Closure creation: Capturing the lexical environment
 
 The C<newclosure> op creates a Closure from a Subroutine and gives that
 Closure a new LexEnv attribute.  The LexEnv is then populated with pointers to
@@ -179,7 +177,7 @@
 Subroutine has an C<:outer()> attribute that points back to the currently
 running Subroutine.  This is a requirement for closures.
 
-=head3 Closure runtime: Using the lexical environment
+=head4 Closure runtime: Using the lexical environment
 
 At runtime, the C<find_lex> opcode behaves differently in closures.  It has no
 need to walk the call stack finding LexPads - they have all already been
@@ -188,7 +186,7 @@
 call frame's LexPad - i.e. the Closure's own lexicals -- and then (2) the
 LexPads in the LexEnv.
 
-=head3 HLL Type Mapping
+=head4 HLL Type Mapping
 
 The implementation of lexical variables in the PIR compiler depends on two new
 PMCs: LexPad and LexInfo.  However, the default Parrot LexPad and LexInfo PMCs
@@ -205,7 +203,7 @@
 information to store, there's no need for TclLexInfo to do anything
 interesting.
 
-=head3 Nested Subroutines Have Outies; the ":outer" attribute
+=head4 Nested Subroutines Have Outies; the ":outer" attribute
 
 For HLLs that support nested subroutines, Parrot provides a way to denote that
 a given subroutine is conceptually "inside" another.  Lookup for lexical
@@ -239,9 +237,9 @@
 appear before "a" in the source text.  Compilers can easily do this via
 preorder traversal of lexically-nested subs.
 
-=head2 Required Interfaces: LexPad, LexInfo, Closure
+=head3 Required Interfaces: LexPad, LexInfo, Closure
 
-=head3 LexInfo
+=head4 LexInfo
 
 Below are the standard LexInfo methods that all HLL LexInfo PMCs may support.
 Each LexInfo PMC should only define the methods that it can usefully
@@ -283,7 +281,7 @@
 
 =back
 
-=head3 LexPad
+=head4 LexPad
 
 LexPads start by implementing the Hash interface: variable names are string
 keys, and variable values are PMCs.
@@ -305,7 +303,7 @@
 
 =back
 
-=head3 Closure
+=head4 Closure
 
 For debugging and introspection, the Closure PMC should support:
 
@@ -318,7 +316,7 @@
 
 =back
 
-=head2 Default Parrot LexPad and LexInfo
+=head3 Default Parrot LexPad and LexInfo
 
 The default LexInfo supports lexicals only as aliases for PMC registers.  It
 therefore implements C<declare_lex_preg()>.  (Internally, it could be a Hash
@@ -330,7 +328,7 @@
 querying its associated LexInfo.  It then gets or sets the given numbered
 register in its associated Parrot Context structure.
 
-=head2 Introspection without Call Frame PMCs
+=head3 Introspection without Call Frame PMCs
 
 Due to implementation concerns, it will not be until late in Parrot
 development -- if ever -- that call frames will be available to user code as
@@ -376,19 +374,19 @@
 
 TODO: Full interpreter introspection interface.
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 TK.
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head1 References
 
 =over 4
 

Modified: branches/vtable_morph_change/docs/pdds/pdd21_namespaces.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd21_namespaces.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd21_namespaces.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,19 +1,17 @@
 # Copyright (C) 2005-2007, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Parrot Namespaces
 
-docs/pdds/pdd21_namespaces.pod - Parrot Namespaces
-
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 ABSTRACT
+=head2 Abstract
 
 Description and implementation of Parrot namespaces.
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 4
 
@@ -33,14 +31,14 @@
 
 =back
 
-=head1 DEFINITIONS
+=head2 Definitions
 
-=head2 "HLL"
+=head3 "HLL"
 
 A High Level Language, such as Perl, Python, or Tcl, in contrast to PIR, which
 is a low-level language.
 
-=head2 "current namespace"
+=head3 "current namespace"
 
 The I<current namespace> at runtime is the namespace associated with the
 currently executing subroutine.  PASM assigns each subroutine a namespace when
@@ -52,9 +50,9 @@
 compiled symbols.)
 
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
-=head2 Namespace Indexing Syntax
+=head3 Namespace Indexing Syntax
 
 Namespaces are denoted in Parrot as simple strings, multidimentional
 hash keys, or arrays of name strings.
@@ -67,7 +65,7 @@
 
 There is no limit to namespace nesting.
 
-=head2 Naming Conventions
+=head3 Naming Conventions
 
 Parrot's target languages have a wide variety of namespace models. By
 implementing an API and standard conventions, it should be possible to
@@ -116,7 +114,7 @@
 
 =back
 
-=head2 Namespace PMC API
+=head3 Namespace PMC API
 
 Most languages leave their symbols plain, which makes lookups quite
 straightforward.  Others use sigils or other mangling techniques, complicating
@@ -125,7 +123,7 @@
 Parrot namespaces assist with interoperability by providing two interface
 subsets: the I<untyped interface> and the I<typed interface>.
 
-=head4 Untyped Interface
+=head5 Untyped Interface
 
 Each HLL may, when working with its own namespace objects, use the I<untyped
 interface>, which allows direct naming in the native style of the namespace's
@@ -154,7 +152,7 @@
 
 =back
 
-=head4 Typed Interface
+=head5 Typed Interface
 
 When a given namespace's HLL is either different from the current HLL or
 unknown, an HLL should generally use only the language-agnostic namespace
@@ -260,9 +258,9 @@
 
 =back
 
-=head2 Compiler PMC API
+=head3 Compiler PMC API
 
-=head3 Methods
+=head4 Methods
 
 =over 4
 
@@ -316,12 +314,12 @@
 
 =back
 
-=head2 Subroutine PMC API
+=head3 Subroutine PMC API
 
 Some information must be available about subroutines to implement the correct
 behavior about namespaces.
 
-=head3 Methods
+=head4 Methods
 
 =over 4
 
@@ -334,7 +332,7 @@
 
 =back
 
-=head2 Namespace Opcodes
+=head3 Namespace Opcodes
 
 The namespace opcodes all have 3 variants: one that operates from the
 currently selected namespace (i.e. the namespace of the currently
@@ -462,16 +460,16 @@
 
 =back
 
-=head2 HLL Namespace Mapping
+=head3 HLL Namespace Mapping
 
 In order to make this work, Parrot must somehow figure out what type of
 namespace PMC to create.
 
-=head3 Default Namespace
+=head4 Default Namespace
 
 The default namespace PMC will implement Parrot's current behavior.
 
-=head3 Compile-time Creation
+=head4 Compile-time Creation
 
 This Perl:
 
@@ -493,7 +491,7 @@
 In this case, the C<main> sub would be tied to Perl 5 by the C<.HLL>
 directive, so a Perl 5 namespace would be created.
 
-=head3 Run-time Creation
+=head4 Run-time Creation
 
 Consider the following Perl 5 program:
 
@@ -529,11 +527,11 @@
 which is in a Perl 5 namespace, so it will create the "Foo" namespace as
 a Perl 5 namespace.
 
-=head1 LANGUAGE NOTES
+=head2 Language Notes
 
-=head2 Perl 6
+=head3 Perl 6
 
-=head3 Sigils
+=head4 Sigils
 
 Perl 6 may wish to be able to access the namespace as a hash with sigils.
 That is certainly possible, even with subroutines and methods.  It's not
@@ -545,9 +543,9 @@
 in this case, append a "&" sigil to the front of the sub/method name and
 search in the internal hash.
 
-=head2 Python
+=head3 Python
 
-=head3 Importing from Python
+=head4 Importing from Python
 
 Since functions and variables overlap in Python's namespaces, when exporting
 to another HLL's namespace, the Python namespace PMC's C<export_to> method
@@ -555,16 +553,16 @@
 C<add_var> or C<add_sub>.  C<$I0 = does $P0, "Sub"> may be enough to decide
 correctly.
 
-=head3 Subroutines and Namespaces
+=head4 Subroutines and Namespaces
 
 Since Python's subroutines and namespaces are just variables (the namespace
 collides there), the Python PMC's C<find_var> method may return subroutines as
 variables.
 
 
-=head2 Examples
+=head3 Examples
 
-=head3 Aliasing
+=head4 Aliasing
 
 Perl:
 
@@ -591,7 +589,7 @@
     ...
   .end
 
-=head3 Cross-language Exportation
+=head4 Cross-language Exportation
 
 Perl 5:
 
@@ -617,15 +615,15 @@
     "write"("this is a tcl command")
   .end
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
 None.
 

Modified: branches/vtable_morph_change/docs/pdds/pdd22_io.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd22_io.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd22_io.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,25 +1,23 @@
 # Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 I/O
 
-docs/pdds/pdd22_io.pod - Parrot I/O
-
-=head1 ABSTRACT
+=head2 Abstract
 
 Parrot's I/O subsystem.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DEFINITIONS
+=head2 Definitions
 
 A "stream" allows input or output operations on a source/destination
 such as a file, keyboard, or text console. Streams are also called
 "filehandles", though only some of them have anything to do with files.
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 4
 
@@ -32,9 +30,9 @@
 
 =back
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
-=head2 Composition
+=head3 Composition
 
 Currently, the Parrot I/O subsystem uses a per-interpreter stack to
 provide a layer-based approach to I/O. Each layer implements a subset of
@@ -47,7 +45,7 @@
 search a stack on each I/O call, while still allowing a "layered"
 combination of functionality for different platforms.
 
-=head2 Concurrency Model for Asynchronous I/O
+=head3 Concurrency Model for Asynchronous I/O
 
 Currently, Parrot only implements synchronous I/O operations. Initially,
 the asynchronous operations will be implemented separately from the
@@ -89,7 +87,7 @@
 [See L<http://en.wikipedia.org/wiki/Asynchronous_I/O>, for a relatively
 comprehensive list of asynchronous I/O implementation options.]
 
-=head2 FileHandle PMC API
+=head3 FileHandle PMC API
 
 Methods
 
@@ -272,7 +270,7 @@
 
 =back
 
-=head2 Status Object PMC API
+=head3 Status Object PMC API
 
 =over 4
 
@@ -319,7 +317,7 @@
 
 =back
 
-=head2 I/O Iterator PMC API
+=head3 I/O Iterator PMC API
 
 [Implementation NOTE: this may either be the default Iterator object
 applied to a FileHandle or Socket object, a separate Iterator object for
@@ -352,7 +350,7 @@
 
 =back
 
-=head2 I/O Opcodes
+=head3 I/O Opcodes
 
 The signatures for the asynchronous operations are nearly identical to
 the synchronous operations, but the asynchronous operations take an
@@ -366,9 +364,9 @@
 or return nothing. Error handling is discussed more thoroughly below in
 L<Error Handling>.
 
-=head2 I/O Stream Opcodes
+=head3 I/O Stream Opcodes
 
-=head3 Opening and closing streams
+=head4 Opening and closing streams
 
 =over 4
 
@@ -406,7 +404,7 @@
 
 =back
 
-=head3 Retrieving existing streams
+=head4 Retrieving existing streams
 
 These opcodes do not have asynchronous variants.
 
@@ -425,7 +423,7 @@
 
 =back
 
-=head3 Writing to streams
+=head4 Writing to streams
 
 =over 4
 
@@ -466,7 +464,7 @@
 
 =back
 
-=head3 Reading from streams
+=head4 Reading from streams
 
 =over 4
 
@@ -517,7 +515,7 @@
 
 =back
 
-=head3 Retrieving and setting stream properties
+=head4 Retrieving and setting stream properties
 
 =over 4
 
@@ -574,7 +572,7 @@
 
 =back
 
-=head2 Filesystem Opcodes
+=head3 Filesystem Opcodes
 
 [Okay, I'm seriously considering moving most of these to methods on the
 ParrotIO object. More than that, moving them into a role that is
@@ -707,7 +705,7 @@
 
 =back
 
-=head2 Network I/O Opcodes
+=head3 Network I/O Opcodes
 
 Most of these opcodes conform to the standard UNIX interface, but the
 layer API allows alternate implementations for each.
@@ -826,7 +824,7 @@
 
 
 
-=head2 Error Handling
+=head3 Error Handling
 
 Currently some of the networking opcodes (C<connect>, C<recv>, C<send>,
 C<poll>, C<bind>, and C<listen>) return an integer indicating the status
@@ -836,7 +834,7 @@
 errors at all. We want to unify all I/O opcodes so they use a consistent
 strategy for error notification.
 
-=head3 Synchronous operations
+=head4 Synchronous operations
 
 Synchronous I/O operations return an integer status code indicating
 success or failure in addition to their ordinary return value(s). This
@@ -847,7 +845,7 @@
 strategy as asynchronous ones?]
 
 
-=head3 Asynchronous operations
+=head4 Asynchronous operations
 
 Asynchronous I/O operations return a status object. The status object
 contains an integer status code, string status/error message, and
@@ -861,7 +859,7 @@
 invoked, and the user will need to check for error conditions in the
 status object as the first operation of the handler code.
 
-=head3 Exceptions
+=head4 Exceptions
 
 At some point in the future, I/O objects may also provide a way to throw
 exceptions on error conditions. This feature will be enabled by calling
@@ -872,7 +870,7 @@
 have to be set at a global scope because execution will have left the
 dynamic scope of the I/O call by the time the error occurs.
 
-=head2 IPv6 Support
+=head3 IPv6 Support
 
 The transition from IPv4 to IPv6 is in progress, though not likely to be
 complete anytime soon. Most operating systems today offer at least
@@ -915,15 +913,15 @@
 (http://www.ietf.org/rfc/rfc4038.txt) and "Basic Socket Interface
 Extensions for IPv6" (http://www.ietf.org/rfc/rfc3493.txt).
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
   src/io/io.c
   src/ops/io.ops

Modified: branches/vtable_morph_change/docs/pdds/pdd23_exceptions.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd23_exceptions.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd23_exceptions.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,20 +1,18 @@
 # Copyright (C) 2001-2007, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Exceptions
 
-docs/pdds/pdd23_exceptions.pod - Parrot Exceptions
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This document defines the requirements and implementation strategy for
 Parrot's exception system.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DESCRIPTION
+=head2 Description
 
 I<Exceptions> are indications by running code that something unusual -- an
 "exception" to the normal processing -- has occurred.  When code detects an
@@ -33,7 +31,7 @@
 the error message describing it, and other ancillary information.  The
 specific type (class) of an exception object indicates its category.)
 
-=head2 Exception Opcodes
+=head3 Exception Opcodes
 
 These are the opcodes relevant to exceptions and exception handlers:
 
@@ -124,7 +122,7 @@
 
 =back
 
-=head2 Exception Introspection Opcodes
+=head3 Exception Introspection Opcodes
 
 These are the opcodes relevant to introspection of the exception handler
 stack:
@@ -138,7 +136,7 @@
 =back
 
 
-=head2 Order of Operations in Exception Handling
+=head3 Order of Operations in Exception Handling
 
 When B<throw> is called, for all active exception handlers, in LIFO order:
 
@@ -179,9 +177,9 @@
 may choose to handle the exception and continue execution by invoking
 the exception's continuation.
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
-=head2 Exception Object Interface
+=head3 Exception Object Interface
 
 All of Parrot's standard exceptions provide at least the following interface.
 It is recommended that all classes intended for throwing also provide at least
@@ -236,7 +234,7 @@
 
 =back
 
-=head2 Standard Parrot Exceptions
+=head3 Standard Parrot Exceptions
 
 Parrot comes with a small hierarchy of classes designed for use as exceptions.
 Parrot throws them when internal Parrot errors occur, but any user code can
@@ -297,7 +295,7 @@
 
 =back
 
-=head2 Opcodes that Throw Exceptions
+=head3 Opcodes that Throw Exceptions
 
 Exceptions have been incorporated into built-in opcodes in a limited way.  For
 the most part, they're used when the return value is either impractical to
@@ -395,9 +393,9 @@
 it still keeps the error information out-of-band, instead of mixing the
 error in with normal return values. }}
 
-=head2 Exception Object Interface
+=head3 Exception Object Interface
 
-=head3 Retrieving the Exception Message
+=head4 Retrieving the Exception Message
 
 The exception message is stored in the 'message' attribute:
 
@@ -410,7 +408,7 @@
   say message
 
 
-=head3 Resuming after Exceptions
+=head4 Resuming after Exceptions
 
 Exceptions thrown by standard Parrot opcodes (like the one thrown by
 C<get_hll_global> above or by the C<throw> opcode) are always resumable,
@@ -437,15 +435,15 @@
   continuation = exception['resume']
   continuation()
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
   src/ops/core.ops
   src/exceptions.c

Modified: branches/vtable_morph_change/docs/pdds/pdd24_events.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd24_events.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd24_events.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,20 +1,18 @@
 # Copyright (C) 2001-2007, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Events
 
-docs/pdds/pdd24_events.pod - Parrot Events
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This document defines the requirements and implementation strategy for
 Parrot's event subsystem.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 4
 
@@ -30,7 +28,7 @@
 
 =back
 
-=head1 DEFINITIONS
+=head2 Definitions
 
 An event is a notification that something has happened: the user has
 manipulated a GUI element, an I/O request has completed, a signal has
@@ -38,7 +36,7 @@
 event handler (often two or three, which is something of a problem),
 because handling events is so fundamental to modern GUI programming.
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 Parrot's event handling system is integrated with the central concurrency
 scheduler. When an event is created (by a GUI element, etc), it is added to
@@ -82,7 +80,7 @@
 The operation to query the concurrency scheduler and find if it has any tasks
 to process is as cheap as possible, so it may be queried at regular intervals.
 
-=head2 Event API
+=head3 Event API
 
 An event is a PMC object that contains a type, data for the event, and a
 priority.
@@ -123,7 +121,7 @@
 In addition to the attributes, an event uses a private PMC flag to mark itself
 as fatal or non-fatal.
 
-=head3 Event Vtable Entries
+=head4 Event Vtable Entries
 
 =over 4
 
@@ -149,7 +147,7 @@
 
 =back
 
-=head2 Event Handler API
+=head3 Event Handler API
 
 An event handler contains a code object, as well as metainformation about
 where it was registered. More specifically, it contains a continuation object,
@@ -194,7 +192,7 @@
 an interpreter object, and knows how to communicate with its remote
 interpreter object (in threaded or clustering concurrency).
 
-=head3 Event Handler Vtable Entries
+=head4 Event Handler Vtable Entries
 
 =over 4
 
@@ -237,7 +235,7 @@
 
 =back
 
-=head2 Opcodes
+=head3 Opcodes
 
 The following opcodes are used with the event system:
 
@@ -278,7 +276,7 @@
 
 =back
 
-=head2 Event Type Hierarchy
+=head3 Event Type Hierarchy
 
 Parrot defines a core set of event types. Users may also define their own
 event types. An event type of 'allevents' is effectively the parent of all
@@ -323,7 +321,7 @@
       interrupt
       childdie
 
-=head2 Signals
+=head3 Signals
 
 Signals are a special form of event. Parrot presents them as mildly special,
 as a remnant of Perl's Unix heritage, but under the hood they're not treated
@@ -344,7 +342,7 @@
 dispatched to an event handler in order of priority and age just like other
 events.
 
-=head2 Timers
+=head3 Timers
 
 A timer is a special kind of event with a time delay. A timer can act as any
 builtin or custom event type. Timers can be be flagged as repeating. Parrot
@@ -352,15 +350,15 @@
 own implementations of timers, which may be used when performance on a
 particular platform is more important than portability.
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
 src/events.c
 

Modified: branches/vtable_morph_change/docs/pdds/pdd25_concurrency.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd25_concurrency.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd25_concurrency.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,20 +1,18 @@
 # Copyright (C) 2001-2007, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Concurrency
 
-docs/pdds/pdd25_concurrency.pod - Parrot Concurrency
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This document defines the requirements and implementation strategy for
 Parrot's concurrency models.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 4
 
@@ -41,7 +39,7 @@
 
 =back
 
-=head1 DEFINITIONS
+=head2 Definitions
 
 Concurrency is a parallel execution of units of code (on multiprocessor
 machines), or a flexible ordering of serial units of code (on single processor
@@ -51,7 +49,7 @@
 
 A task is a unit of code that can be executed concurrently.
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 Rather than defining a single canonical threading model, Parrot defines
 an infrastructure that supports multiple concurrency models and provides
@@ -90,7 +88,7 @@
 concurrency, but does include occasional notes on how it integrates with
 shared-interpreter concurrency.
 
-=head2 Supported Concurrency Models
+=head3 Supported Concurrency Models
 
 The following are a few of the concurrency models Parrot intends to
 support. The biggest differences between them are in how they handle
@@ -98,7 +96,7 @@
 each of the different models can run simultaneously, coordinated through the
 central concurrency scheduler.
 
-=head3 Mutex/Lock Concurrency
+=head4 Mutex/Lock Concurrency
 
 In this model, before performing an operation on a shared variable, you
 must first acquire a lock on it. Once a lock is acquired, any other
@@ -115,7 +113,7 @@
 acquire the mutex of the PMCs in its parameter list (in ascending
 address order). In this model only PMCs can be shared.
 
-=head3 STM Concurrency
+=head4 STM Concurrency
 
 Parrot's preferred model of concurrency is based on Software
 Transactional Memory. In this model, rather than locking a shared
@@ -139,14 +137,14 @@
 transaction attempting to commit to a variable locked by a mutex/lock
 task.
 
-=head3 POSIX Concurrency
+=head4 POSIX Concurrency
 
 This is the POSIX "share-everything" style of threading, such as is used
 in Perl 5's "pthread" model, as well as the thread models for Ruby and
 Python. [Recommended reading: "Programming with POSIX Threads" by Dave
 Butenhof.]
 
-=head3 Process-type Concurrency
+=head4 Process-type Concurrency
 
 This is the Perl 5 "iThreads" threading model. In this model no data is
 shared implicitly, and all sharing must be done on purpose and
@@ -154,7 +152,7 @@
 fork-process-with-shared-memory-segment model, not a surprise as it was
 originally developed with emulation of Unix's fork system in mind.
 
-=head3 Independent Concurrency
+=head4 Independent Concurrency
 
 Independent tasks have no contact with the internal data of any other
 task in the current process. These are implemented as STM concurrency
@@ -164,7 +162,7 @@
 passing either atomic things (ints, floats, and pointers) or static
 buffers that can become the property of the destination thread.
 
-=head3 Intel Threading Building Blocks
+=head4 Intel Threading Building Blocks
 
 Threading Building Blocks (TBB) is a library of tools for data-parallel
 programming, dividing large data sets into small pieces so that
@@ -185,7 +183,7 @@
 Note that since TBB is a C++ library, it is only available when Parrot
 is compiled with a C++ compiler.
 
-=head2 Concurrrency Scheduler API
+=head3 Concurrrency Scheduler API
 
 The concurrency scheduler has two parts, a Scheduler PMC, which has an
 instance stored in the interpreter struct, and a set of core routines in
@@ -249,13 +247,13 @@
 an appropriate task (event, exception). See PDD 24 on Events for more details
 on event handlers.
 
-=head3 Flags
+=head4 Flags
 
 PMC flags 0-7 are reserved for private use by a PMC. The scheduler uses flag 0
 to indicate whether the priority index is currently valid or needs to be
 recalculated before the next use.
 
-=head3 Vtable Functions
+=head4 Vtable Functions
 
 =over 4
 
@@ -270,7 +268,7 @@
 
 =back
 
-=head3 Methods
+=head4 Methods
 
 =over 4
 
@@ -289,7 +287,7 @@
 
 =back
 
-=head2 Task PMC API
+=head3 Task PMC API
 
 The interface of the Task PMC is also the minimum required interface for all
 subclasses, extensions, and alternate implementations of a task.
@@ -347,7 +345,7 @@
 simple code block. The interpreter structure is also optional and only used
 for thread-like tasks that maintain their own interpreter state.
 
-=head3 Vtable Functions
+=head4 Vtable Functions
 
 =over 4
 
@@ -361,7 +359,7 @@
 
 =back
 
-=head2 Opcodes
+=head3 Opcodes
 
 =over 4
 
@@ -400,15 +398,15 @@
 
 =back
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
 Dec 2003 - (Dan ponders threads based on POSIX and Perl 5 experience)
 <http://groups.google.com/group/perl.perl6.internals/browse_frm/thread/e64b22ab7de0a7a6/889b5d8c4cd267b7?lnk=gst&q=threads&rnum=3#889b5d8c4cd267b7>

Modified: branches/vtable_morph_change/docs/pdds/pdd26_ast.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd26_ast.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd26_ast.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,20 +1,18 @@
 # Copyright (C) 2007, The Perl Foundation
 # $Id$
 
-=head1 NAME
+=head1 Compiler Tools - Abstract Syntax Tree
 
-docs/pdds/pdd26_ast.pod - Parrot Abstract Syntax Tree
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This PDD describes the node types and semantics of the Parrot
 Abstract Syntax Tree representation.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DESCRIPTION
+=head2 Description
 
 The Parrot Abstract Syntax Tree (PAST) is a set of Parrot
 classes useful for generating an abstract semantic representation
@@ -29,9 +27,9 @@
 while also being extensible to support the unique needs of
 specific languages.
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
-=head2 PAST::Node
+=head3 PAST::Node
 
 C<PAST::Node> is the base class for all nodes in an abstract
 syntax tree.  Each C<PAST::Node> element has an array of
@@ -110,13 +108,13 @@
 
 =back
 
-=head2 PAST::Stmts
+=head3 PAST::Stmts
 
 C<PAST::Stmts> is simply a C<PAST::Node> used to contain a
 sequence of other PAST nodes to be evaluated.  It has no
 specific methods or attributes.
 
-=head2 PAST::Val
+=head3 PAST::Val
 
 C<PAST::Val> nodes represent constant values in the abstract
 syntax tree.  The C<value> attribute represents the value of
@@ -136,7 +134,7 @@
 
 =back
 
-=head2 PAST::Var
+=head3 PAST::Var
 
 C<PAST::Var> nodes represent variable-like items within the
 abstract syntax tree.  The C<name> attribute (inherited from
@@ -268,7 +266,7 @@
 
 =back
 
-=head2 PAST::Op
+=head3 PAST::Op
 
 C<PAST::Op> nodes represent the operations in an abstract
 syntax tree.  The primary function of the node is given by
@@ -464,7 +462,7 @@
 
 =back
 
-=head2 PAST::Block
+=head3 PAST::Block
 
 C<PAST::Block> nodes represent lexical scopes within an abstract
 syntax tree, and roughly translate to individual Parrot subroutines.
@@ -549,20 +547,16 @@
 
 =back
 
-=head2 PAST::CompUnit
+=head3 PAST::CompUnit
 
 C<PAST::CompUnit> nodes are used for the abstract representation
 of compilation units.  Specific attributes and semantics are
 yet to be determined.
 
-=head1 REFERENCES
+=head2 References
 
 NA.
 
-=head1 COPYRIGHT
-
-Copyright (C) 2007, The Perl Foundation.
-
 =cut
 
 __END__

Modified: branches/vtable_morph_change/docs/pdds/pdd27_multiple_dispatch.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd27_multiple_dispatch.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd27_multiple_dispatch.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,19 +1,17 @@
 # Copyright (C) 2007, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Multiple Dispatch
 
-docs/pdds/pdd27_multiple_dispatch.pod - Multiple Dispatch
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This PDD defines Parrot's multiple dispatch system.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DEFINITIONS
+=head2 Definitions
 
 Multiple dispatch allows a single function name to be associated with several
 alternate implementations. It selects the alternate to execute for a
@@ -25,7 +23,7 @@
 A similar selection of alternates based on types at compile time is generally
 called overloading.
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 4
 
@@ -48,7 +46,7 @@
 
 =back
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 The aim of Parrot's multiple dispatch system is not to be an exact match to
 any one HLL, but to provide the features and tools needed to support multiple
@@ -64,7 +62,7 @@
 MultiSub. Calls to multiple dispatch routines use the Parrot calling
 conventions.
 
-=head2 MultiSub PMC API
+=head3 MultiSub PMC API
 
 A MultiSub stores a list of subroutines. When a MultiSub is invoked, it calls
 an MMD sorting routine to select the best candidate for the current arguments,
@@ -76,7 +74,7 @@
 An alternate multiple dispatch matching algorithm may be plugged in by
 subclassing MultiSub and overriding C<invoke>.
 
-=head3 Vtable Functions
+=head4 Vtable Functions
 
 MultiSub defines the following vtable functions in addition to the ones
 inherited from ResizablePMCArray.
@@ -136,7 +134,7 @@
 
 =back
 
-=head3 Methods
+=head4 Methods
 
 =over 4
 
@@ -151,7 +149,7 @@
 
 =back
 
-=head3 PIR subroutine attributes
+=head4 PIR subroutine attributes
 
 The following attributes are used when declaring a MultiSub in PIR.
 
@@ -180,7 +178,7 @@
 
 =back
 
-=head2 C Multiple Dispatch API
+=head3 C Multiple Dispatch API
 
 These functions are the public interface to common multiple dispatch
 operations, and may be called from opcodes, vtable functions, or other C
@@ -218,7 +216,7 @@
 
 =back
 
-=head2 Opcode Multiple Dispatch
+=head3 Opcode Multiple Dispatch
 
 Parrot's basic opcodes are not multiple dispatch. They appear to be so, since
 a single opcode name may have multiple signatures. But, behind the scenes,
@@ -237,7 +235,7 @@
 {{NOTE: It is no longer necessary to name multisubs used for opcode dispatch
 using the "__" names.}}
 
-=head2 Vtable Multiple Dispatch
+=head3 Vtable Multiple Dispatch
 
 Some PMCs call multiple dispatch routines from their vtable functions.
 ResizablePMCArray, for example, calls the multiple dispatch equality operation
@@ -246,11 +244,11 @@
 Multiple dispatch calls from within vtable functions call the
 C<Parrot_mmd_invoke> routine from the public MMD API.
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 None.
 
-=head1 REFERENCES
+=head2 References
 
 docs/mmd.pod
 src/multidispatch.c

Modified: branches/vtable_morph_change/docs/pdds/pdd28_strings.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd28_strings.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd28_strings.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,42 +1,40 @@
 # Copyright (C) 2008-2009, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 Strings
 
-docs/pdds/pdd28_strings.pod - Parrot Strings
-
-=head1 ABSTRACT
+=head2 Abstract
 
 This PDD describes the conventions for strings in Parrot,
 including but not limited to support for multiple character sets,
 encodings, and languages.
 
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 DEFINITIONS
+=head2 Definitions
 
-=head2 Character
+=head3 Character
 
 A character is the abstract description of a symbol. It's the smallest
 chunk of text a computer knows how to deal with. Internally to
 the computer, a character (just like everything else) is a number, so
 a few further definitions are needed.
 
-=head2 Character Set
+=head3 Character Set
 
 The Unicode Standard prefers the concepts of I<character repertoire> (a
 collection of characters) and I<character code> (a mapping which tells you
 what number represents which character in the repertoire). Character set is
 commonly used to mean the standard which defines both a repertoire and a code.
 
-=head2 Codepoint
+=head3 Codepoint
 
 A codepoint is the numeric representation of a character according to a
 given character set. So in ASCII, the character C<A> has codepoint 0x41.
 
-=head2 Encoding
+=head3 Encoding
 
 An encoding determines how a codepoint is represented inside a computer.
 Simple encodings like ASCII define that the codepoints 0-127 simply
@@ -51,14 +49,14 @@
 character set functions will ask a string's encoding functions to
 retrieve data from the string, and then process the retrieved data.
 
-=head2 Combining Character
+=head3 Combining Character
 
 A combining character is a Unicode concept. It is a character which
 modifies the preceding character. For instance, accents, lines, circles,
 boxes, etc. which are not to be displayed on their own, but to be
 composed with the preceding character.
 
-=head2 Grapheme
+=head3 Grapheme
 
 In linguistics, a grapheme is a single symbol in a writing system (letter,
 number, punctuation mark, kanji, hiragana, Arabic glyph, Devanagari symbol,
@@ -70,7 +68,7 @@
 characters.  Because graphemes are the highest-level abstract idea of a
 "character", they're useful for converting between character sets.
 
-=head2 Normalization Form
+=head3 Normalization Form
 
 A normalization form standardizes the representation of a string by
 transforming a sequence of combining characters into a more complex character
@@ -81,12 +79,12 @@
 composition, NFD and NFKD are decomposition. See L<Unicode Normalization
 Forms|http://www.unicode.org/reports/tr15/> for more details.
 
-=head2 Grapheme Normalization Form
+=head3 Grapheme Normalization Form
 
 Grapheme normalization form (NFG) is a normalization which allocates exactly
 one codepoint to each grapheme.
 
-=head1 DESCRIPTION
+=head2 Description
 
 =over 3
 
@@ -118,7 +116,7 @@
 
 =back
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 Parrot was designed from the outset to support multiple string formats:
 multiple character sets and multiple encodings. We don't standardize on
@@ -132,7 +130,7 @@
 writing C<*s++> or any other C string idioms, you need to stop and think if
 that's what you really mean. Not everything is byte-based anymore.
 
-=head2 Grapheme Normalization Form
+=head3 Grapheme Normalization Form
 
 Unicode characters can be expressed in a number of different ways according to
 the Unicode Standard. This is partly to do with maintaining compatibility with
@@ -197,7 +195,7 @@
 grapheme operations will allow them to safely manipulate Unicode data without
 changing their string semantics.
 
-=head3 Advantages
+=head4 Advantages
 
 Applications that don't care about graphemes can handle a NFG codepoint in a
 string as if it's any other character. Only applications that care about the
@@ -213,7 +211,7 @@
 codepoint, NFG strings are useful as an intermediate representation for
 converting between string types.
 
-=head3 Disadvantages
+=head4 Disadvantages
 
 A 32-bit encoding is quite large, considering the fact that the Unicode
 codespace only requires up to C<0x10FFFF>. The Unicode Consortium's FAQ notes
@@ -229,7 +227,7 @@
 is in, and provide functions to convert between normalization forms. The
 conceptual cost of one additional normalization form is relatively small.
 
-=head3 The grapheme table
+=head4 The grapheme table
 
 When constructing strings in NFG, graphemes not expressible as a single
 character in Unicode are represented by a dynamic codepoint index into the
@@ -248,7 +246,7 @@
                 });
    push @string, $codepoint;
 
-=head2 String API
+=head3 String API
 
 Strings in the Parrot core should use the Parrot C<STRING> structure. Parrot
 developers generally shouldn't deal with C<char *> or other string-like types
@@ -338,7 +336,7 @@
 complicates the entire string subsystem for a tiny optimization on substring
 operations, and offset math is messy with encodings that aren't byte-based.}}
 
-=head3 Conversions between normalization form, encoding, and charset
+=head4 Conversions between normalization form, encoding, and charset
 
 Conversion will be done with a function called C<Parrot_str_grapheme_copy>:
 
@@ -355,48 +353,48 @@
 intermediate NFG representation.
 
 
-=head2 String Interface Functions
+=head3 String Interface Functions
 
 The current string functions will be maintained, with some modifications for
 the addition of the NFG string format. Many string functions that are part of
 Parrot's external API will be renamed for the standard "Parrot_*" naming
 conventions.
 
-=head3 Parrot_str_set (was string_set)
+=head4 Parrot_str_set (was string_set)
 
 Set one string to a copy of the value of another string.
 
-=head3 Parrot_str_new_COW (was Parrot_make_COW_reference)
+=head4 Parrot_str_new_COW (was Parrot_make_COW_reference)
 
 Create a new copy-on-write string. Creating a new string header, clone the
 struct members of the original string, and point to the same string buffer as
 the original string.
 
-=head3 Parrot_str_reuse_COW (was Parrot_reuse_COW_reference)
+=head4 Parrot_str_reuse_COW (was Parrot_reuse_COW_reference)
 
 Create a new copy-on-write string. Clone the struct members of the original
 string into a passed in string header, and point the reused string header to
 the same string buffer as the original string.
 
-=head3 Parrot_str_write_COW (was Parrot_unmake_COW)
+=head4 Parrot_str_write_COW (was Parrot_unmake_COW)
 
 If the specified Parrot string is copy-on-write, copy the string's contents
 to a new string buffer and clear the copy-on-write flag.
 
-=head3 Parrot_str_concat (was string_concat)
+=head4 Parrot_str_concat (was string_concat)
 
 Concatenate two strings. Takes three arguments: two strings, and one integer
 value of flags. If both string arguments are null, return a new string created
 according to the integer flags.
 
-=head3 Parrot_str_append (was string_append)
+=head4 Parrot_str_append (was string_append)
 
 Append one string to another and return the result. In the default case, the
 return value is the same as the first string argument (modifying that argument
 in place). If the first argument is COW or read-only, then the return value is
 a new string.
 
-=head3 Parrot_str_new (was string_from_cstring)
+=head4 Parrot_str_new (was string_from_cstring)
 
 Return a new string with the default encoding and character set. Accepts two
 arguments, a C string (C<char *>) to initialize the value of the string, and
@@ -406,11 +404,11 @@
 {{NOTE: the integer length isn't really necessary, and is under consideration
 for deprecation.}}
 
-=head3 Parrot_str_new_noinit (was string_make_empty)
+=head4 Parrot_str_new_noinit (was string_make_empty)
 
 Returns a new empty string with the default encoding and chararacter set.
 
-=head3 Parrot_str_new_init (was string_make_direct)
+=head4 Parrot_str_new_init (was string_make_direct)
 
 Returns a new string of the requested encoding, character set, and
 normalization form, initializing the string value to the value passed in.  The
@@ -425,49 +423,49 @@
 C<Parrot_find_encoding> and C<Parrot_find_charset> can look up the encoding or
 character set structs. }}
 
-=head3 Parrot_str_new_constant (was const_string)
+=head4 Parrot_str_new_constant (was const_string)
 
 Creates and returns a new Parrot constant string. Takes one C string (a C<char
 *>) as an argument, the value of the constant string. The length of the C
 string is calculated internally.
 
-=head3 Parrot_str_resize (was string_grow)
+=head4 Parrot_str_resize (was string_grow)
 
 Resize the string buffer of the given string adding the number of bytes passed
 in the integer argument. If the argument is negative, remove the given number
 of bytes. Throws an exception if shrinking the string buffer size will
 truncate the string (if C<strlen> will be longer than C<buflen>).
 
-=head3 Parrot_str_length (was string_compute_strlen)
+=head4 Parrot_str_length (was string_compute_strlen)
 
 Returns the number of characters in the string. Combining characters are each
 counted separately. Variable-width encodings may lookahead.
 
-=head3 Parrot_str_grapheme_length
+=head4 Parrot_str_grapheme_length
 
 Returns the number of graphemes in the string. Groups of combining characters
 count as a single grapheme.
 
-=head3 Parrot_str_byte_length (was string_length)
+=head4 Parrot_str_byte_length (was string_length)
 
 Returns the number of bytes in the string. The character width of
 variable-width encodings is ignored. Combining characters are not treated any
 differently than other characters. This is equivalent to accessing the
 C<strlen> member of the C<STRING> struct directly.
 
-=head3 Parrot_str_indexed (was string_index)
+=head4 Parrot_str_indexed (was string_index)
 
 Returns the character at the specified index (the Nth character from the start
 of the string). Combining characters are counted separately. Variable-width
 encodings will lookahead to capture full character values.
 
-=head3 Parrot_str_grapheme_indexed
+=head4 Parrot_str_grapheme_indexed
 
 Returns the grapheme at the given index (the Nth grapheme from the string's
 start). Groups of combining characters count as a single grapheme, so this
 function may return multiple characters.
 
-=head3 Parrot_str_find_index (was string_str_index)
+=head4 Parrot_str_find_index (was string_str_index)
 
 Search for a given substring within a string. If it's found, return an integer
 index to the substring's location (the Nth character from the start of the
@@ -475,81 +473,81 @@
 will lookahead to capture full character values. Returns -1 unless the
 substring is found.
 
-=head3 Parrot_str_copy (was string_copy)
+=head4 Parrot_str_copy (was string_copy)
 
 Make a COW copy a string (a new string header pointing to the same string
 buffer).
 
-=head3 Parrot_str_grapheme_copy (new)
+=head4 Parrot_str_grapheme_copy (new)
 
 Accepts two string arguments: a destination and a source. Iterates through the
 source string one grapheme at a time and appends it to the destination string.
 
 This function can be used to convert a string of one format to another format.
 
-=head3 Parrot_str_repeat (was string_repeat)
+=head4 Parrot_str_repeat (was string_repeat)
 
 Return a string containing the passed string argument, repeated the number of
 times in the integer argument.
 
-=head3 Parrot_str_substr (was string_substr)
+=head4 Parrot_str_substr (was string_substr)
 
 Return a substring starting at an integer offset with an integer length. The
 offset and length specify characters. Combining characters are counted
 separately. Variable-width encodings will lookahead to capture full character
 values.
 
-=head3 Parrot_str_grapheme_substr
+=head4 Parrot_str_grapheme_substr
 
 Return a substring starting at an integer offset with an integer length. The
 offset and length specify graphemes. Groups of combining characters count as a
 single grapheme.
 
-=head3 Parrot_str_replace (was string_replace)
+=head4 Parrot_str_replace (was string_replace)
 
 Replaces a substring within the first string argument with the second string
 argument. An integer offset and length, in characters, specify where the
 removed substring starts and how long it is.
 
-=head3 Parrot_str_grapheme_replace
+=head4 Parrot_str_grapheme_replace
 
 Replaces a substring within the first string argument with the second string
 argument. An integer offset and length in graphemes specify where the removed
 substring starts and how long it is.
 
-=head3 Parrot_str_chopn (was string_chopn)
+=head4 Parrot_str_chopn (was string_chopn)
 
 Chop the requested number of characters off the end of a string without
 modifying the original string.
 
-=head3 Parrot_str_chopn_inplace (was string_chopn_inplace).
+=head4 Parrot_str_chopn_inplace (was string_chopn_inplace).
 
 Chop the requested number of characters off the end of a string, modifying the
 original string.
 
-=head3 Parrot_str_grapheme_chopn
+=head4 Parrot_str_grapheme_chopn
 
 Chop the requested number of graphemes off the end of a string without
 modifying the original string.
 
-=head3 Parrot_str_compare (was string_compare)
+=head4 Parrot_str_compare (was string_compare)
 
 Compare two strings to each other. Return 0 if they are equal, 1 if the first
 is greater and -1 if the second is greater. Uses character set collation order
 for the comparison. (Two strings that are logically equivalent in terms of
 display, but stored in different normalizations are not equal.)
 
-=head3 Parrot_str_grapheme_compare
+=head4 Parrot_str_grapheme_compare
 
 Compare two strings to each other. Return 0 if they are equal, 1 if the first
 is greater and -1 if the second is greater. Uses NFG normalization to compare
 the two strings.
 
-=head3 Parrot_str_equal
+=head4 Parrot_str_equal
 
 Compare two strings, return 1 if they are equal, 0 if they are not equal.
 
-=head3 Parrot_str_not_equal (was string_equal)
+=head4 Parrot_str_not_equal (was string_equal)
 
 Compare two strings, return 0 if they are equal, 1 if they are not equal.
 
@@ -557,31 +555,31 @@
 the old logic, but 'Parrot_str_not_equal' is provided as a drop-in
 replacement for the old function.}}
 
-=head3 Parrot_str_grapheme_equal
+=head4 Parrot_str_grapheme_equal
 
 Compare two strings using NFG normalization, return 1 if they are equal, 0 if
 they are not equal.
 
-=head2 Internal String Functions
+=head3 Internal String Functions
 
 The following functions are used internally and are not part of the public
 interface.
 
-=head3 Parrot_str_init (was string_init)
+=head4 Parrot_str_init (was string_init)
 
 Initialize Parrot's string subsystem, including string allocation and garbage
 collection.
 
-=head3 Parrot_str_finish (was string_deinit)
+=head4 Parrot_str_finish (was string_deinit)
 
 Terminate and clean up Parrot's string subsystem, including string allocation
 and garbage collection.
 
-=head3 Parrot_str_free (was string_free)
+=head4 Parrot_str_free (was string_free)
 
 Free the string's header.
 
-=head3 string_max_bytes
+=head4 string_max_bytes
 
 Calculate the number of bytes needed to hold a given number of characters in a
 particular encoding, multiplying the maximum possible width of a character in
@@ -589,67 +587,67 @@
 
 {{NOTE: pretty primitive and not very useful. May be deprecated.}}
 
-=head2 Deprecated String Functions
+=head3 Deprecated String Functions
 
 The following string functions are slated to be deprecated.
 
-=head3 string_primary_encoding_for_representation
+=head4 string_primary_encoding_for_representation
 
 Not useful, it only ever returned ASCII.
 
-=head3 string_rep_compatible
+=head4 string_rep_compatible
 
 Only useful on a very narrow set of string encodings/character sets.
 
-=head3 string_make
+=head4 string_make
 
 A crippled version of a string initializer, now replaced with the full version
 C<Parrot_string_new_init>.
 
-=head3 string_capacity
+=head4 string_capacity
 
 This was used to calculate the size of the buffer after the C<strstart>
 pointer. Deprecated with C<strstart>.
 
-=head3 string_ord
+=head4 string_ord
 
 Replaced by C<Parrot_str_indexed>.
 
-=head3 string_chr
+=head4 string_chr
 
 This is handled just fine by C<Parrot_str_new>, we don't need a special
 version for a single character.
 
-=head3 make_writable
+=head4 make_writable
 
 An archaic function that uses a method of describing strings that hasn't been
 allowed for years.
 
-=head3 string_to_cstring_nullable
+=head4 string_to_cstring_nullable
 
 Just the implementation of string_to_cstring, no need for a separate function
 that specially allows returning a NULL string.
 
-=head3 string_increment
+=head4 string_increment
 
 Old Perl 5-style behavior where "aa" goes to "bb". Only useful for ASCII
 strings, and not terribly useful even there.
 
-=head3 Parrot_string_cstring
+=head4 Parrot_string_cstring
 
 Unsafe, and behavior handled by Parrot_str_to_cstring.
 
 
-=head3 Parrot_string_split
+=head4 Parrot_string_split
 
 Is the same as Parrot_str_split.
 
-=head2 String PMC API
+=head3 String PMC API
 
 The String PMC provides a high-level object interface to the string
 functionality. It contains a standard Parrot string, holding the string data.
 
-=head3 Vtable Functions
+=head4 Vtable Functions
 
 The String PMC implements the following vtable functions.
 
@@ -804,7 +802,7 @@
 
 =back
 
-=head3 Methods
+=head4 Methods
 
 The String PMC provides the following methods.
 
@@ -842,7 +840,7 @@
 =back
 
 
-=head1 REFERENCES
+=head2 References
 
 http://sirviente.9grid.es/sources/plan9/sys/doc/utf.ps - Plan 9's Runes are
 not dissimilar to NFG strings, and this is a good introduction to the Unicode

Modified: branches/vtable_morph_change/docs/pdds/pdd_template.pod
==============================================================================
--- branches/vtable_morph_change/docs/pdds/pdd_template.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/pdds/pdd_template.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,47 +1,45 @@
 # Copyright (C) 2001-2008, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 PDD Template
 
-docs/pdds/pdd_template.pod - PDD Template
-
-=head1 VERSION
+=head2 Version
 
 $Revision$
 
-=head1 ABSTRACT
+=head2 Abstract
 
 Summary of the contents of the PDD.
 
-=head1 SYNOPSIS I<(optional)>:
+=head2 Synopsis I<(optional)>
 
 Code snippets showing the semantics of the PDD (if applicable).
 
-=head1 DESCRIPTION
+=head2 Description
 
 Description of the subject.
 
-=head1 DEFINITIONS
+=head2 Definitions
 
 Definitions of important terms. (optional)
 
-=head1 IMPLEMENTATION
+=head2 Implementation
 
 Implementation details.
 
-=head1 LANGUAGE NOTES
+=head2 Language Notes
 
 Notes on application to high-level languages. (optional)
 
-=head1 ATTACHMENTS
+=head2 Attachments
 
 Any associated documents.
 
-=head1 FOOTNOTES
+=head2 Footnotes
 
 List of footnotes to the text.
 
-=head1 REFERENCES
+=head2 References
 
 List of references.
 

Modified: branches/vtable_morph_change/docs/project/metacommitter_guide.pod
==============================================================================
--- branches/vtable_morph_change/docs/project/metacommitter_guide.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/project/metacommitter_guide.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -64,7 +64,7 @@
 =back
 
 Congratulate the new member publicly by sending an email to
-parrot-porters at perl.org, and copying the new committer.
+parrot-dev at lists.parrot.org, and copying the new committer.
 
 =head2 To manage the list of Metacommitters
 

Modified: branches/vtable_morph_change/docs/project/ubuntu_packaging_guide.pod
==============================================================================
--- branches/vtable_morph_change/docs/project/ubuntu_packaging_guide.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/project/ubuntu_packaging_guide.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,5 +1,5 @@
 # Copyright (C) 2007-2009, The Perl Foundation.
-# $Id: debian_packaging_guide.pod 35946 2009-01-24 06:06:14Z allison $
+# $Id$
 
 =head1 Ubuntu Packaging Guide
 
@@ -29,67 +29,71 @@
 
 =item 2.
 
-Create a new directory. (The name is irrelevant, but we'll use ~/udeb/parrot for
+Create a new directory. (The name is irrelevant, but we'll use F<~/udeb/parrot> for
 the sake of illustration.)
 
-Create a fresh extract of the tarball in the ~/udeb/parrot directory. The
-directory should be named "parrot-<version>" (it will be by default).
+Create a fresh extract of the tarball in the F<~/udeb/parrot> directory. The
+directory should be named F<parrot-[version]> (it will be by default).
 
-Copy the debian/ directory from the Parrot source tree into the fresh tarball
-extract.
+Copy the original tarball into F<~/udeb/parrot>, naming it
+F<parrot_[version].orig.tar.gz> (note the "_" in place of dash).
 
-  cp -r <path/to/parrot/svn>/ports/debian ~/udeb/parrot/parrot-<version>/.
+=item 3.
 
-Copy the original tarball into ~/udeb/parrot, naming it
-"parrot_<version>.orig.tar.gz" (note the "_" in place of dash).
+Copy the F<ports/debian/> directory from the Parrot source tree into the fresh
+tarball extract.
+
+  cp -r <path/to/parrot/svn>/ports/debian ~/udeb/parrot/parrot-[version]/.
+
+Integrate any new change entries from F<ports/debian/changelog> into
+F<ports/ubuntu/changelog>, preserving chronological order. Copy the Ubuntu
+changelog file over the F<changelog> file in
+F<~/udeb/parrot/parrot-[version]/debian>.
 
 =item 4.
 
-Update the debian/changelog file in ~/udeb/parrot/parrot-<version>/ to add an
-entry for the Ubuntu package. Copy the first line from the Debian changelog.
-Add C<ubuntu#> after the Debian version to indicate the Ubuntu revision of the
-package, and for PPA uploads also add C<~ppa#>. Change the Debian branch
-('unstable') to the target Ubuntu distribution ('intrepid').
+Update the F<changelog> file in F<~/udeb/parrot/parrot-[version]/debian/> to
+add an entry for the Ubuntu package. Copy the first line from the Debian
+changelog.  Add C<ubuntu#> after the Debian version to indicate the Ubuntu
+revision of the package, and for PPA uploads also add C<~ppa#>. Instead of the
+Debian branch ('unstable') use the target Ubuntu distribution ('intrepid').
 
   parrot (0.5.1-1ubuntu1) intrepid; urgency=low
 
-The changelog entry for the Ubuntu release is generally just:
+The changelog entry for the Ubuntu release is generally:
 
-  * New upstream release.
+  * Resynchronize with Debian unstable.
 
-The final line gives the maintainer's name, email address, and the date. The
-date must be in RFC822 format, and can be generated by running C<date -R>.
-(Note that two spaces are required between the email and the date.)
+Add any custom changes for Ubuntu packaging (rare). The final line gives the
+maintainer's name, email address, and the date. The date must be in RFC822
+format, and can be generated by running C<date -R>. (Note that two spaces are
+required between the email and the date.)
 
    -- Your Name <you at example.org>  Sun, 30 Dec 2007 17:21:45 +0000
 
-=item 8.
+=item 5.
 
 Install all dependencies:
 
   $ sudo /usr/lib/pbuilder/pbuilder-satisfydepends
 
-=item 9.
+=item 6.
 
-Build the source packages. From ~/udeb/parrot/parrot_<version>/, run:
+Build the source packages. From F<~/udeb/parrot/parrot_[version]/>, run:
 
   $ debuild -S -sa
 
-=item X.
+=item 7.
 
 Update Parrot's PPA with the new release (configured in ChrootSetup):
 
-  $ dput parrot-ppa parrot_<version>_source.changes
+  $ dput parrot-ppa parrot_[version]_source.changes
 
-=item 11.
+=item 8.
 
-Don't commit Ubuntu-specific changes to the debian/ directory in the
+Commit the Ubuntu F<changelog> file to the F<ports/ubuntu/> directory in the
 repository. (At the moment, we're keeping the Debian packages as the primary.)
 
 =back
 
-=head1 SEE ALSO
-
-F<README>, F<RESPONSIBLE_PARTIES>.
-
 =cut

Modified: branches/vtable_morph_change/docs/running.pod
==============================================================================
--- branches/vtable_morph_change/docs/running.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/running.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -131,36 +131,38 @@
 
 =item -R, --runcore CORE
 
-Select the runcore. The following cores are available:
+Select the runcore. The following cores are available in Parrot, but not all
+may be available on your system:
 
   slow, bounds  bounds checking core (default)
-  fast          fast core (no bounds checking, profiling, or tracing)
-  switch        switch core
-  cgp           computed goto-predereferenced core
   cgoto         computed goto core
-  jit           JIT core
+  cgp           computed goto-predereferenced core
   cgp-jit       computed goto-predereferenced core with JIT
-  switch-jit    switch core with JIT
   exec          exec core (uses JIT at compile time to generate native code)
-  trace         bounds checking core w/ trace info (see 'parrot --help-debug')
+  fast          fast core (no bounds checking, profiling, or tracing)
   gcdebug       performs a full GC run before every op dispatch (good for
                 debugging GC problems)
+  jit           JIT core
+  switch        switch core
+  switch-jit    switch core with JIT
+  trace         bounds checking core w/ trace info (see 'parrot --help-debug')
 
 =item -b, --bounds-checks, --slow-core
 
 Select the bounds-checking slow core (default).
 
+=item -g, --computed-goto-core
+
+Select the CGoto core (if available).
+
 =item -C, --CGP-core
 
 Select the CGP (CGoto Predereferenced) core (if available).
 
 =item -f, --fast-core
 
-Select the fast (or function) core.
-
-=item -g, --computed-goto-core
-
-Select the CGoto core (if available).
+Select the fast (or function) core.  Bounds checking, profiling, and tracing
+are not available. (That's why it's so fast.)
 
 =item -j, --jit-core
 

Modified: branches/vtable_morph_change/docs/submissions.pod
==============================================================================
--- branches/vtable_morph_change/docs/submissions.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/submissions.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -262,8 +262,8 @@
 repository. So the usual rules for Parrot patches apply for this content.
 
 For changes specific for parrotcode.org please send patches to B<webmaster>
-I<at> B<perl> I<dot> B<org>, and cc B<parrot-porters> I<at> B<perl> I<dot>
-B<org>.
+I<at> B<perl> I<dot> B<org>, and cc B<parrot-dev> I<at> B<lists> I<dot>
+B<parrot> I<dot> B<org>.
 
 =head1 Getting Commit Privileges
 
@@ -293,7 +293,7 @@
 
 =item 4
 
-Request commit access via the C<parrot-porters> mailing list, or via IRC
+Request commit access via the C<parrot-dev> mailing list, or via IRC
 (#parrot on irc.perl.org).  The existing commiters will discuss your request in
 the next couple of weeks.
 

Modified: branches/vtable_morph_change/docs/tests.pod
==============================================================================
--- branches/vtable_morph_change/docs/tests.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/tests.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -62,7 +62,7 @@
 =head2 Testing Parrot Assembler
 
 PASM tests are mostly used for testing ops.  Appropriate test files for basic
-ops are F<t/op/*.t>.  Perl Magic Cookies are tested in F<t/pmc/*.t>.  Add the
+ops are F<t/op/*.t>.  Polymorphic Containers are tested in F<t/pmc/*.t>.  Add the
 new test like this:
 
     pasm_output_is(<<'CODE', <<'OUTPUT', "name for test");

Modified: branches/vtable_morph_change/docs/user/pir/pp001-intro.pod
==============================================================================
--- branches/vtable_morph_change/docs/user/pir/pp001-intro.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/user/pir/pp001-intro.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -55,7 +55,7 @@
 
 =item S - string
 
-=item P - PMC (Parrot Magic Cookie)
+=item P - polymorphic container (PMC)
 
 =back
 
@@ -329,7 +329,7 @@
 
 With the PIR syntax shown in this article you should be able to start
 writing simple programs. Next article we will look into available
-Parrot Magic Cookies (PMCs), and how they can be used.
+Polymorphic Containers (PMCs), and how they can be used.
 
 =head2 Author
 

Modified: branches/vtable_morph_change/docs/user/pir/pp002-pmc.pod
==============================================================================
--- branches/vtable_morph_change/docs/user/pir/pp002-pmc.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/user/pir/pp002-pmc.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -41,7 +41,7 @@
 
 Integers, strings, and arbitrary floating point numbers are
 common data types in most programming languages, but what's
-a PMC? PMC stands for "Parrot Magic Cookie". PMCs are how
+a PMC? PMC stands for "Polymorphic Container". PMCs are how
 Parrot handles more complicated structures and behaviors
 (hence the magic :) Some examples of PMC usage would be for
 arrays, hashes, data structures, objects, etc. Anything that

Modified: branches/vtable_morph_change/docs/vtables.pod
==============================================================================
--- branches/vtable_morph_change/docs/vtables.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/docs/vtables.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -7,7 +7,7 @@
 
 =head1 Implementing Variable Types with Vtables
 
-This is a guide to creating your own PMC (Parrot Magic Cookie) classes.  It
+This is a guide to creating your own PMC (Polymorphic Container) classes.  It
 tells you what you need to write in order to add new variable types to Parrot.
 
 =head2 Overview

Modified: branches/vtable_morph_change/editor/pir-mode.el
==============================================================================
--- branches/vtable_morph_change/editor/pir-mode.el	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/editor/pir-mode.el	Tue Feb 10 02:09:33 2009	(r36517)
@@ -13,7 +13,7 @@
 ;;   (add-to-list 'auto-mode-alist '("\\.pir\\'" . pir-mode))
 
 ;; If you have any problems with this, you're on your own,
-;; You could always try asking on parrot-porters at perl.org.
+;; You could always try asking on parrot-dev at lists.parrot.org.
 
 ;;; Code:
 (require 'regexp-opt)
@@ -422,7 +422,7 @@
   (add-to-list 'auto-mode-alist '(\"\\\\.pir\\\\'\" . pir-mode))
 
 If you have any problems with this, you're on your own. You could always
-try asking on parrot-porters at perl.org."
+try asking on parrot-dev at lists.parrot.org."
   (interactive)
   (kill-all-local-variables)
   (use-local-map pir-mode-map)

Modified: branches/vtable_morph_change/examples/benchmarks/array_access.pir
==============================================================================
--- branches/vtable_morph_change/examples/benchmarks/array_access.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/examples/benchmarks/array_access.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
 # $Id$
 
 =head1 NAME
@@ -15,7 +15,7 @@
 
 =cut
 
-.sub main :main
+.sub 'main' :main
     .param pmc argv
 
     load_bytecode "Getopt/Obj.pbc"
@@ -26,7 +26,7 @@
 
     # Specification of command line arguments.
     .local pmc getopts
-    getopts = new "Getopt::Obj"
+    getopts = new [ 'Getopt::Obj' ]
     push getopts, "arr-size=i"
 
     .local pmc opt
@@ -34,18 +34,19 @@
 
     .local int arr_size
     arr_size = 100
+
     .local int def
-    def = defined opt["arr-size"]
+    def = defined opt['arr-size']
     unless def goto use_default_arr_size
-        arr_size = opt['arr-size']
-use_default_arr_size:
+
+    arr_size = opt['arr-size']
+  use_default_arr_size:
 
     _bench( 'Array', arr_size )
     _bench( 'FixedFloatArray', arr_size )
     _bench( 'FixedIntegerArray', arr_size )
     _bench( 'FixedPMCArray', arr_size )
     _bench( 'FixedStringArray', arr_size )
-    _bench( 'IntList', arr_size )
     _bench( 'ResizableFloatArray', arr_size )
     _bench( 'ResizableIntegerArray', arr_size )
     _bench( 'ResizablePMCArray', arr_size )

Modified: branches/vtable_morph_change/examples/nci/Mysql.pir
==============================================================================
--- branches/vtable_morph_change/examples/nci/Mysql.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/examples/nci/Mysql.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -15,6 +15,8 @@
 
 =cut
 
+.include 'datatypes.pasm'
+
 ########################################################################
 
 .namespace ['Mysql']
@@ -421,7 +423,7 @@
     $I1 = 0
     $I2 = 0
 nextcol:
-    desc [$I2] = -69
+    desc [$I2] = .DATATYPE_CSTR
     inc $I2
     desc [$I2] = 1
     inc $I2

Modified: branches/vtable_morph_change/examples/pir/pirric.pir
==============================================================================
--- branches/vtable_morph_change/examples/pir/pirric.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/examples/pir/pirric.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -36,6 +36,8 @@
 # - Calls to functions in foreign namespaces
 #
 # Command line options:
+# -d Parrot debugger mode. Jumps to the debugger after each
+#    TRON line inform and after the 'Ready' prompt.
 # -t Trace on. Same as the TRON instruction
 # -p all remaining arguments are executed as PRINT instructions
 #-----------------------------------------------------------------------
@@ -92,6 +94,7 @@
     addattribute runnerclass, 'curline'
     addattribute runnerclass, 'vars'
     addattribute runnerclass, 'stack'
+    addattribute runnerclass, 'debugger'
     addattribute runnerclass, 'tron'
 
     $P0 = get_class 'String'
@@ -207,6 +210,7 @@
     le $I0, $I1, no_prog
     .local string arg
     arg = args[$I1]
+    if arg == '-d' goto opt_debugger
     if arg == '-t' goto opt_tron
     if arg == '-p' goto print_items
 
@@ -216,6 +220,11 @@
     $I0 = 1
     goto start
 
+opt_debugger:
+    runner.'debugger'()
+    inc $I1
+    goto read_args
+
 opt_tron:
     runner.'trace'(1)
     inc $I1
@@ -377,6 +386,9 @@
     $P0 = new 'Integer'
     $P0 = 0
     setattribute self, 'tron', $P0
+    $P0 = new 'Integer'
+    $P0 = 0
+    setattribute self, 'debugger', $P0
     $P1 = new 'ResizablePMCArray'
     setattribute self, 'stack', $P1
     $P2 = new 'Integer'
@@ -469,6 +481,12 @@
 .end
 
 #-----------------------------------------------------------------------
+.sub debugger :method
+    $P0 = getattribute self, 'debugger'
+    $P0 = 1
+.end
+
+#-----------------------------------------------------------------------
 .sub trace :method
     .param int level
 
@@ -524,11 +542,13 @@
 
     arg1 = self.'evaluate'(tokenizer)
     $P0 = tokenizer.'get'()
+    if_null $P0, fail
     $I0 = defined $P0
     unless $I0 goto fail
     ne $P0, ',', fail
     arg2 = self.'evaluate'(tokenizer)
     $P0 = tokenizer.'get'()
+    if_null $P0, fail
     $I0 = defined $P0
     unless $I0 goto fail
     ne $P0, ')', fail
@@ -557,6 +577,7 @@
     push args, arg
     null arg
     delim = tokenizer.'get'()
+    if_null delim, fail
     $I0 = defined delim
     unless $I0 goto fail
     eq delim, ')', endargs
@@ -1066,9 +1087,11 @@
 
 getvar:
     $P2 = tokenizer.'get'()
+    if_null $P2, donevar
     eq $P2, '.', dotted
     eq $P2, '(', isfunctor
     tokenizer.'back'()
+donevar:
     .return(var)
 
 isfunctor:
@@ -1124,12 +1147,17 @@
     $P0 = self.'eval_base'(tokenizer, token)
 again:
     $P1 = tokenizer.'get'()
+    if_null $P1, done
+    $I0 = defined $P1
+    unless $I0 goto done
     eq $P1, '[', keyit
     tokenizer.'back'()
+done:
     .return($P0)
 keyit:
     $P2 = self.'evaluate'(tokenizer)
     $P1 = tokenizer.'get'()
+    if_null $P1, fail
     eq $P1, ']', last
     ne $P1, ',', fail
     $P3 = $P0 [$P2]
@@ -1156,8 +1184,10 @@
     $P0 = self.'eval_base_1'(tokenizer, token)
 more:
     $P1 = tokenizer.'get'()
+    if_null $P1, done
     eq $P1, '^', dopow
     tokenizer.'back'()
+done:
     .return($P0)
 dopow:
     $P2 = self.'eval_unary'(tokenizer)
@@ -1175,8 +1205,10 @@
     $P0 = self.'eval_pow'(tokenizer, token)
 more:
     $P1 = tokenizer.'get'()
+    if_null $P1, done
     eq $P1, 'MOD', domod
     tokenizer.'back'()
+done:
     .return($P0)
 domod:
     $P2 = self.'eval_pow'(tokenizer)
@@ -1227,9 +1259,11 @@
     $P0 = self.'eval_unary'(tokenizer, token)
 more:
     $P1 = tokenizer.'get'()
+    if_null $P1, done
     eq $P1, '*', domul
     eq $P1, '/', dodiv
     tokenizer.'back'()
+done:
     .return($P0)
 domul:
     $P2 = self.'eval_unary'(tokenizer)
@@ -1253,9 +1287,11 @@
     $P0 = self.'eval_mul'(tokenizer, token)
 more:
     $P1 = tokenizer.'get'()
+    if_null $P1, done
     eq $P1, '+', doadd
     eq $P1, '-', dosub
     tokenizer.'back'()
+done:
     .return($P0)
 
 doadd:
@@ -1294,10 +1330,12 @@
     $P0 = self.'eval_add'(tokenizer, token)
 more:
     $P1 = tokenizer.'get'()
+    if_null $P1, done
     eq $P1, '=', doequal
     eq $P1, '<', doless
     eq $P1, '>', dogreat
     tokenizer.'back'()
+done:
     .return($P0)
 doequal:
     $P2 = self.'eval_add'(tokenizer)
@@ -1361,6 +1399,7 @@
     .local pmc program
     .local pmc stack
     .local pmc iter
+    .local pmc debugger
     .local pmc tron
     .local pmc pircontrol
     .local int stopline
@@ -1374,6 +1413,7 @@
     stack = getattribute self, 'stack'
 
     tron = getattribute self, 'tron'
+    debugger = getattribute self, 'debugger'
     stopline = 0
 
     pcurline = new 'Integer'
@@ -1400,6 +1440,9 @@
     print curline
     print ']'
 
+    unless debugger goto executeline    
+    debug_break
+
 executeline:
     program = getattribute self, 'program'
     $S1 = program [curline]
@@ -1570,9 +1613,15 @@
     .local pmc program
     program = getattribute self, 'program'
     .local string line
+    .local pmc debugger
+    debugger = getattribute self, 'debugger'
 
     say 'Ready'
+    
 reinit:
+    unless debugger goto doreadline
+    debug_break
+doreadline:
     line = readlinebas(stdin, 1)
 
     .local pmc tokenizer
@@ -1580,6 +1629,7 @@
 
     tokenizer = newTokenizer(line)
     token = tokenizer.'get'()
+    if_null token, reinit
     $I0 = isa token, 'Integer'
     unless $I0 goto execute
 
@@ -1643,6 +1693,7 @@
 keyed_next:
     index = self.'evaluate'(tokenizer)
     op = tokenizer.'get'()
+    if_null op, fail
     eq op, ']', last
     ne op, ',', fail
     auxobj = obj[index]
@@ -1898,6 +1949,7 @@
     .local pmc arg
     arg = self.'evaluate'(tokenizer)
     $P1 = tokenizer.'get'()
+    if_null $P1, notype
     $I1 = defined $P1
     unless $I1 goto notype
     ne $P1, ',', notype
@@ -2000,7 +2052,9 @@
     self.'set_error_exit'($I0)
     goto finish
 on_error_goto:
-    $P0 = self.'evaluate'(tokenizer)
+    $P0 = tokenizer.'get'()
+    $I0 = defined $P0
+    unless $I0 goto fail
     $I0 = $P0
     self.'set_error_goto'($I0)
     goto finish
@@ -2311,10 +2365,12 @@
     goto doit
 
 endline:
-    last = new 'Undef'
+#    last = new 'Undef'
+    null last
     setattribute self, 'last', last
     .local pmc none
-    none = new 'Undef'
+#    none = new 'Undef'
+    null none
     .return(none)
 
 doit:

Modified: branches/vtable_morph_change/ext/Parrot-Embed/lib/Parrot/Embed.xs
==============================================================================
--- branches/vtable_morph_change/ext/Parrot-Embed/lib/Parrot/Embed.xs	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/ext/Parrot-Embed/lib/Parrot/Embed.xs	Tue Feb 10 02:09:33 2009	(r36517)
@@ -12,202 +12,209 @@
 
 typedef struct Interpreter_struct
 {
-	SV            *parent;
-	Parrot_Interp  interp;
+    SV            *parent;
+    Parrot_Interp  interp;
 } Interpreter_struct;
 
 typedef struct PMC_struct
 {
-	SV         *interp;
-	Parrot_PMC  pmc;
+    SV         *interp;
+    Parrot_PMC  pmc;
 } PMC_struct;
 
+
 Interpreter_struct*
 make_interp( pTHX_ SV *parent, PARROT_INTERP )
 {
-	Interpreter_struct *interp_struct;
-	if (interp == NULL)
-		return NULL;
+    Interpreter_struct *interp_struct;
+
+    if (!interp)
+        return NULL;
 
-	New( 0, interp_struct, 1, Interpreter_struct );
+    New( 0, interp_struct, 1, Interpreter_struct );
 
-	SvREFCNT_inc( parent );
-	interp_struct->parent = parent;
-	interp_struct->interp = interp;
+    SvREFCNT_inc( parent );
+    interp_struct->parent = parent;
+    interp_struct->interp = interp;
 
-	return interp_struct;
+    return interp_struct;
 }
 
+
 PMC_struct*
 make_pmc( pTHX_ SV *interp, Parrot_PMC pmc )
 {
-	PMC_struct *pmc_struct;
-	if (pmc == NULL)
-		return NULL;
+    PMC_struct *pmc_struct;
 
-	New( 0, pmc_struct, 1, PMC_struct );
+    if (!pmc)
+        return NULL;
 
-	SvREFCNT_inc( interp );
-	pmc_struct->interp = interp;
-	pmc_struct->pmc    = pmc;
+    New( 0, pmc_struct, 1, PMC_struct );
 
-	Parrot_register_pmc( get_interp( interp ), pmc );
+    SvREFCNT_inc( interp );
+    pmc_struct->interp = interp;
+    pmc_struct->pmc    = pmc;
 
-	return pmc_struct;
+    Parrot_register_pmc( get_interp( interp ), pmc );
+
+    return pmc_struct;
 }
 
+
 MODULE = Parrot::Embed PACKAGE = Parrot::Interpreter
 
 Parrot_Interp
 new( class, ... )
-	char *class
+    char *class
 PREINIT:
-	SV *parent_sv = NULL;
-	Parrot_Interp parent;
-	Parrot_Interp interp;
-	Parrot_PackFile pf;
-CODE:
-	if (items == 1)
-	{
-		parent = 0;
-	}
-	else if ( items == 2 && sv_derived_from( ST(1), "Parrot::Interpreter" ))
-	{
-		parent_sv = ST(1);
-		parent    = get_interp( parent_sv );
-	}
-	else
-	{
-		Perl_croak( aTHX_ "Usage: Parrot::Interpreter->new( [ parent ] )" );
-	}
-	interp = Parrot_new( (Parrot_Interp)parent );
-	pf     = PackFile_new( interp, 0 );
-	Parrot_loadbc( interp, pf );
-
-	/* Can't use RETVAL/OUTPUT here because typemap loses class variable */
-	ST(0)  = sv_newmortal();
-	sv_setref_pv( ST(0), class, (void*)make_interp( aTHX_ parent_sv, interp ) );
+    SV             *parent_sv = NULL;
+    Parrot_Interp   parent;
+    Parrot_Interp   interp;
+    Parrot_PackFile pf;
+CODE:
+    if (items == 1)
+        parent = 0;
+    else if ( items == 2 && sv_derived_from( ST(1), "Parrot::Interpreter" ))
+    {
+        parent_sv = ST(1);
+        parent    = get_interp( parent_sv );
+    }
+    else
+        Perl_croak( aTHX_ "Usage: Parrot::Interpreter->new( [ parent ] )" );
+
+    interp = Parrot_new( (Parrot_Interp)parent );
+    pf     = PackFile_new( interp, 0 );
+    Parrot_loadbc( interp, pf );
+
+    /* Can't use RETVAL/OUTPUT here because typemap loses class variable */
+    ST(0)  = sv_newmortal();
+    sv_setref_pv( ST(0), class, (void*)make_interp( aTHX_ parent_sv, interp ) );
+
 
 bool
 load_file( interp, filename )
-	Interpreter_struct *interp
-	char *filename
+    Interpreter_struct *interp
+    char               *filename
 PREINIT:
-	Parrot_Interp real_interp;
-	Parrot_PackFile pf;
+    Parrot_Interp   real_interp;
+    Parrot_PackFile pf;
 CODE:
-	real_interp = interp->interp;
-	pf = Parrot_readbc( real_interp, filename );
-	if (pf == NULL)
-		Perl_croak( aTHX_ \
-		"File '%s' not found in $parrot_interpreter->load_file()", filename );
+    real_interp = interp->interp;
+    pf          = Parrot_readbc( real_interp, filename );
 
-	Parrot_loadbc( real_interp, pf );
-	RETVAL = 1;
+    if (!pf)
+        Perl_croak( aTHX_
+        "File '%s' not found in $parrot_interpreter->load_file()", filename );
+
+    Parrot_loadbc( real_interp, pf );
+    RETVAL = 1;
 OUTPUT:
-	RETVAL
+    RETVAL
+
 
 PMC_struct*
 find_global( interp, global, ... )
-	Interpreter_struct *interp
-	char *global
+    Interpreter_struct *interp
+    char               *global
 PREINIT:
-	Parrot_Interp  real_interp;
-	SV            *namespace;
-	Parrot_String  p_namespace;
-	Parrot_String  p_global;
-	Parrot_PMC     pmc;
-CODE:
-	if ( items < 2 || items > 3 )
-	{
-		Perl_croak( aTHX_
-			"Usage: $parrot_interpreter->find_global( name, [ namespace ] )");
-	}
-
-	real_interp     = interp->interp;
-	p_global        = Parrot_str_new_constant( real_interp, global );
-
-	if ( items == 3 )
-		namespace   = ST(2);
-	else
-		namespace   = &PL_sv_undef;
-
-	if (namespace  != &PL_sv_undef )
-	{
-		p_namespace = Parrot_str_new_constant( real_interp, SvPVX( namespace ) );
-		pmc         = Parrot_find_global_s(real_interp, p_namespace, p_global);
-	}
-	else
-		pmc         = Parrot_find_global_cur( real_interp, p_global );
+    SV            *namespace;
+    Parrot_Interp  real_interp;
+    Parrot_String  p_namespace;
+    Parrot_String  p_global;
+    Parrot_PMC     pmc;
+CODE:
+    if ( items < 2 || items > 3 )
+        Perl_croak( aTHX_
+            "Usage: $parrot_interpreter->find_global( name, [ namespace ] )");
+
+    real_interp     = interp->interp;
+    p_global        = Parrot_str_new_constant( real_interp, global );
+
+    if ( items == 3 )
+        namespace   = ST(2);
+    else
+        namespace   = &PL_sv_undef;
+
+    if (namespace  != &PL_sv_undef )
+    {
+        p_namespace = Parrot_str_new_constant( real_interp, SvPVX(namespace) );
+        pmc         = Parrot_find_global_s(real_interp, p_namespace, p_global);
+    }
+    else
+        pmc         = Parrot_find_global_cur( real_interp, p_global );
 
-	RETVAL = make_pmc( aTHX_ ST(0), pmc );
+    RETVAL = make_pmc( aTHX_ ST(0), pmc );
 OUTPUT:
-	RETVAL
+    RETVAL
+
 
 PMC_struct*
 compile( interp, code )
-	Interpreter_struct *interp
-	char * code
+    Interpreter_struct *interp
+    char               *code
 PREINIT:
-	Parrot_Interp  real_interp;
-	STRING        *code_type;
-	STRING        *error;
-	Parrot_PMC     out_pmc;
-CODE:
-	real_interp = interp->interp;  
-	code_type   = Parrot_str_new_constant( real_interp, "PIR" );
-	out_pmc     = Parrot_compile_string( real_interp, code_type, code, &error );
-	RETVAL      = make_pmc( aTHX_ ST(0), out_pmc );
+    STRING        *code_type;
+    STRING        *error;
+    Parrot_Interp  real_interp;
+    Parrot_PMC     out_pmc;
+CODE:
+    real_interp = interp->interp;
+    code_type   = Parrot_str_new_constant( real_interp, "PIR" );
+    out_pmc     = Parrot_compile_string( real_interp, code_type, code, &error );
+    RETVAL      = make_pmc( aTHX_ ST(0), out_pmc );
 OUTPUT:
-	RETVAL
+    RETVAL
+
 
 void
 DESTROY( interp )
-	Interpreter_struct *interp
+    Interpreter_struct *interp
 CODE:
-	if ( interp->parent != NULL )
-		SvREFCNT_dec( interp->parent );
+    if (interp->parent)
+        SvREFCNT_dec( interp->parent );
 
-	Parrot_destroy( interp->interp );
+    Parrot_destroy( interp->interp );
 
 MODULE = Parrot::Embed PACKAGE = Parrot::PMC
 
+
 PMC_struct*
 invoke( pmc, signature, argument )
-	PMC_struct *pmc
-	const char *signature
-	const char *argument
-PREINIT:
-	Parrot_PMC    pmc_actual;
-	Parrot_PMC    out_pmc;
-	Parrot_Interp interp;
-	Parrot_String arg_string;
-CODE:
-	pmc_actual = pmc->pmc;
-	interp     = get_interp( pmc->interp );
-	arg_string = Parrot_str_new_constant( interp, argument );
-	out_pmc    = Parrot_call_sub( interp, pmc_actual, signature, arg_string );
-	RETVAL     = make_pmc( aTHX_ pmc->interp, out_pmc );
+    PMC_struct *pmc
+    const char *signature
+    const char *argument
+PREINIT:
+    Parrot_PMC    pmc_actual;
+    Parrot_PMC    out_pmc;
+    Parrot_Interp interp;
+    Parrot_String arg_string;
+CODE:
+    pmc_actual = pmc->pmc;
+    interp     = get_interp( pmc->interp );
+    arg_string = Parrot_str_new_constant( interp, argument );
+    out_pmc    = Parrot_call_sub( interp, pmc_actual, signature, arg_string );
+    RETVAL     = make_pmc( aTHX_ pmc->interp, out_pmc );
 OUTPUT:
-	RETVAL
+    RETVAL
+
 
 char *
 get_string( pmc )
-	PMC_struct *pmc
+    PMC_struct *pmc
 CODE:
-	RETVAL = Parrot_PMC_get_cstring( get_interp( pmc->interp ), pmc->pmc );
+    RETVAL = Parrot_PMC_get_cstring( get_interp( pmc->interp ), pmc->pmc );
 OUTPUT:
-	RETVAL
+    RETVAL
 
 void
 DESTROY( pmc )
-	PMC_struct *pmc
+    PMC_struct *pmc
 PREINIT:
-	Parrot_Interp interp;
+    Parrot_Interp interp;
 CODE:
-	interp = get_interp( pmc->interp );
+    interp = get_interp( pmc->interp );
 
-	if ( interp != NULL )
-		SvREFCNT_dec( interp );
+    if (interp)
+        SvREFCNT_dec( interp );
 
-	Parrot_unregister_pmc( interp, pmc->pmc );
+    Parrot_unregister_pmc( interp, pmc->pmc );

Modified: branches/vtable_morph_change/include/parrot/datatypes.h
==============================================================================
--- branches/vtable_morph_change/include/parrot/datatypes.h	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/include/parrot/datatypes.h	Tue Feb 10 02:09:33 2009	(r36517)
@@ -25,7 +25,6 @@
     enum_type_STRING,
     enum_type_PMC,              /* actual PMCs have positive class numbers */
     enum_type_BIGINT,
-    enum_type_BIGNUM,           /* might be different */
     enum_type_DPOINTER,
 
     enum_type_char,             /* native integer types */
@@ -82,7 +81,6 @@
     { "STRING", sizeof (void *) },
     { "PMC",    sizeof (void *) },           /* actual PMCs have positive class numbers */
     { "BIGINT", sizeof (void *) },
-    { "BIGNUM", sizeof (void *) },          /* might be different */
     { "DPOINTER", sizeof (void *) },
 
     { "char",   sizeof (char) },          /* native integer types */

Modified: branches/vtable_morph_change/include/parrot/encoding.h
==============================================================================
--- branches/vtable_morph_change/include/parrot/encoding.h	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/include/parrot/encoding.h	Tue Feb 10 02:09:33 2009	(r36517)
@@ -152,7 +152,9 @@
         __attribute__nonnull__(3);
 
 void parrot_deinit_encodings(void);
-void parrot_init_encodings_2(void);
+void Parrot_str_internal_register_encoding_names(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
 #define ASSERT_ARGS_Parrot_default_encoding __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
 #define ASSERT_ARGS_Parrot_encoding_c_name __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
 #define ASSERT_ARGS_Parrot_encoding_name __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
@@ -180,7 +182,9 @@
     || PARROT_ASSERT_ARG(encodingname) \
     || PARROT_ASSERT_ARG(encoding)
 #define ASSERT_ARGS_parrot_deinit_encodings __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_parrot_init_encodings_2 __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_Parrot_str_internal_register_encoding_names \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/string/encoding.c */
 

Modified: branches/vtable_morph_change/include/parrot/interpreter.h
==============================================================================
--- branches/vtable_morph_change/include/parrot/interpreter.h	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/include/parrot/interpreter.h	Tue Feb 10 02:09:33 2009	(r36517)
@@ -356,8 +356,7 @@
 
     const char *output_file;                  /* where to write output */
 
-    PDB_t  *pdb;                              /* Debug system */
-    Interp *debugger;                         /* trace / debug interpreter */
+    PDB_t  *pdb;                              /* debug /trace system */
 
     struct Stack_Chunk *dynamic_env;          /* current dynamic environment */
 

Modified: branches/vtable_morph_change/include/parrot/parrot.h
==============================================================================
--- branches/vtable_morph_change/include/parrot/parrot.h	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/include/parrot/parrot.h	Tue Feb 10 02:09:33 2009	(r36517)
@@ -118,7 +118,6 @@
 
 typedef struct PMC PMC;
 typedef void STRING_FUNCS;
-typedef void BIGNUM;
 typedef struct parrot_interp_t Interp;
 
 /* weird architectures might need this, s. C-FAQ 5.17
@@ -144,11 +143,11 @@
 #  define UINTVAL2PTR(any, d)    (any)(d)
 #else
 #  if PTR_SIZE == LONG_SIZE
-#    define INTVAL2PTR(any, d)    (any)(unsigned long)(d)
-#    define UINTVAL2PTR(any, d)    (any)(unsigned long)(d)
+#    define INTVAL2PTR(any, d)    ((any)(unsigned long)(d))
+#    define UINTVAL2PTR(any, d)    ((any)(unsigned long)(d))
 #  else
-#    define INTVAL2PTR(any, d)    (any)(unsigned int)(d)
-#    define UINTVAL2PTR(any, d)    (any)(unsigned int)(d)
+#    define INTVAL2PTR(any, d)    ((any)(unsigned int)(d))
+#    define UINTVAL2PTR(any, d)    ((any)(unsigned int)(d))
 #  endif /* PTR_SIZE == LONG_SIZE */
 #endif /* PTR_SIZE == INTVAL_SIZE */
 #define PTR2INTVAL(p)    INTVAL2PTR(INTVAL, (p))

Modified: branches/vtable_morph_change/include/parrot/string_funcs.h
==============================================================================
--- branches/vtable_morph_change/include/parrot/string_funcs.h	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/include/parrot/string_funcs.h	Tue Feb 10 02:09:33 2009	(r36517)
@@ -298,10 +298,11 @@
     ARGIN_NULLOK(const char *buffer),
     UINTVAL len,
     ARGIN(const ENCODING *encoding),
-    ARGIN_NULLOK(const CHARSET *charset),
+    ARGIN(const CHARSET *charset),
     UINTVAL flags)
         __attribute__nonnull__(1)
-        __attribute__nonnull__(4);
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5);
 
 PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
@@ -638,7 +639,8 @@
     || PARROT_ASSERT_ARG(s)
 #define ASSERT_ARGS_Parrot_str_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
-    || PARROT_ASSERT_ARG(encoding)
+    || PARROT_ASSERT_ARG(encoding) \
+    || PARROT_ASSERT_ARG(charset)
 #define ASSERT_ARGS_Parrot_str_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_str_not_equal __attribute__unused__ int _ASSERT_ARGS_CHECK = \

Modified: branches/vtable_morph_change/include/parrot/sub.h
==============================================================================
--- branches/vtable_morph_change/include/parrot/sub.h	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/include/parrot/sub.h	Tue Feb 10 02:09:33 2009	(r36517)
@@ -332,8 +332,8 @@
         FUNC_MODIFIES(*sub_pmc);
 
 void Parrot_continuation_check(PARROT_INTERP,
-    ARGIN(PMC *pmc),
-    ARGIN(Parrot_cont *cc))
+    ARGIN(const PMC *pmc),
+    ARGIN(const Parrot_cont *cc))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);

Modified: branches/vtable_morph_change/languages/lua/config/makefiles/root.in
==============================================================================
--- branches/vtable_morph_change/languages/lua/config/makefiles/root.in	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/config/makefiles/root.in	Tue Feb 10 02:09:33 2009	(r36517)
@@ -314,6 +314,7 @@
 	- $(PERL) @build_dir@/t/codingstd/filenames.t $(T_C)
 	- $(PERL) @build_dir@/t/codingstd/linelength.t $(T_C)
 	- $(PERL) @build_dir@/t/codingstd/svn_id.t $(T_C)
+	- $(PERL) @build_dir@/t/codingstd/tabs.t $(T_C)
 	- $(PERL) @build_dir@/t/codingstd/trailing_space.t $(T_C)
 
 codetest-make:
@@ -324,26 +325,30 @@
 	- $(PERL) @build_dir@/t/codingstd/svn_id.t $(T_MAKE)
 	- $(PERL) @build_dir@/t/codingstd/trailing_space.t $(T_MAKE)
 
-codetest-perl:
+codetest-perl: clean
 	- $(PERL) @build_dir@/t/codingstd/copyright.t $(T_PERL)
 	- $(PERL) @build_dir@/t/codingstd/cuddled_else.t $(T_PERL)
 	- $(PERL) @build_dir@/t/codingstd/filenames.t $(T_PERL)
 #	- $(PERL) @build_dir@/t/codingstd/linelength.t $(T_PERL)
+	- $(PERL) @build_dir@/t/codingstd/perlcritic.t $(T_PERL)
 	- $(PERL) @build_dir@/t/codingstd/svn_id.t $(T_PERL)
 	- $(PERL) @build_dir@/t/codingstd/trailing_space.t $(T_PERL)
 
-codetest-pir:
+codetest-pir: clean
 	- $(PERL) @build_dir@/t/codingstd/copyright.t $(T_PIR)
 	- $(PERL) @build_dir@/t/codingstd/filenames.t $(T_PIR)
 #	- $(PERL) @build_dir@/t/codingstd/linelength.t $(T_PIR)
 	- $(PERL) @build_dir@/t/codingstd/pir_code_coda.t $(T_PIR)
 	- $(PERL) @build_dir@/t/codingstd/svn_id.t $(T_PIR)
+	- $(PERL) @build_dir@/t/codingstd/tabs.t $(T_PIR)
 	- $(PERL) @build_dir@/t/codingstd/trailing_space.t $(T_PIR)
 
 codetest-pod:
 	- $(PERL) @build_dir@/t/codingstd/copyright.t $(T_POD)
 	- $(PERL) @build_dir@/t/codingstd/linelength.t $(T_POD)
 	- $(PERL) @build_dir@/t/codingstd/svn_id.t $(T_POD)
+	- $(PERL) @build_dir@/t/codingstd/tabs.t $(T_POD)
+	- $(PERL) @build_dir@/t/codingstd/trailing_space.t $(T_POD)
 	- $(PERL) @build_dir@/t/doc/pod.t $(T_POD)
 
 # run the test suite, create a TAP archive and send it off to smolder

Modified: branches/vtable_morph_change/languages/lua/doc/lua51.bnf
==============================================================================
--- branches/vtable_morph_change/languages/lua/doc/lua51.bnf	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/doc/lua51.bnf	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,11 +1,9 @@
-# Copyright (C) 2005-2008, The Perl Foundation.
+# Copyright (C) 2005-2009, The Perl Foundation.
 # $Id$
 
-=head1 NAME
+=head1 The Complete Syntax of Lua
 
-lua51.bnf - The Complete Syntax of Lua
-
-=head1 DESCRIPTION
+=head2 Description
 
 The following grammar comes from "Lua 5.1 Reference Manual".
 

Modified: branches/vtable_morph_change/languages/lua/doc/running.pod
==============================================================================
--- branches/vtable_morph_change/languages/lua/doc/running.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/doc/running.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,33 +1,30 @@
-# Copyright (C) 2005-2008, The Perl Foundation.
+# Copyright (C) 2005-2009, The Perl Foundation.
 # $Id$
 
-=head1 TITLE
+=head1 Using Lua on Parrot
 
-Using Lua on Parrot
-
-=head1 In brief
+=head2 In brief
 
 C<lua.pbc> is the Lua interpreter.
 
-=head1 Building
+=head2 Building
 
 After building C<parrot> (see F<docs/gettingstarted.pod>):
 
   cd languages/lua
   make
 
-=head1 Running the whole test suite
+=head2 Running the whole test suite
 
   make test
 
-=head1 Testing the test suite
+=head2 Testing the test suite
 
 With an original C<Lua> in your path, it's possible to check the test suite.
 
-  cd languages
-  perl -I../lib -Ilua/t lua/t/harness --use-lua
+  perl t/harness --use-lua
 
-=head1 Running your own code
+=head2 Running your own code
 
   ../../parrot lua.pbc example.lua
 
@@ -35,15 +32,15 @@
 
   ../../parrot lua.pbc
 
-=head1 BUGS & LIMITATIONS
+=head2 Bugs & Limitations
 
 See F<languages/lua/doc/status.pod>
 
-=head1 SEE ALSO
+=head2 See Also
 
 F<languages/lua/doc/status.pod>
 
-=head1 AUTHOR
+=head2 Author
 
 Francois Perrad.
 

Modified: branches/vtable_morph_change/languages/lua/doc/status.pod
==============================================================================
--- branches/vtable_morph_change/languages/lua/doc/status.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/doc/status.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,11 +1,9 @@
-# Copyright (C) 2005-2008, The Perl Foundation.
+# Copyright (C) 2005-2009, The Perl Foundation.
 # $Id$
 
-=head1 TITLE
+=head1 Status of Lua on Parrot
 
-Status of Lua on Parrot
-
-=head1 Introduction
+=head2 Introduction
 
 Lua is an extension programming language designed to support general
 procedural programming with data description facilities. It also offers
@@ -19,7 +17,7 @@
 
 This implementation is aligned with Lua 5.1 specifications.
 
-=head1 PIR Compiler/Interpreter
+=head2 PIR Compiler/Interpreter
 
 C<lua.pbc> is the interpreter/compiler, see F<languages/lua/src/lua51.pir>
 & F<languages/lua/lua.pir>.
@@ -62,7 +60,7 @@
 
 The code generation could be examined with F<languages/lua/luap.pir>.
 
-=head2 KNOWN PROBLEMS
+=head3 KNOWN PROBLEMS
 
 in F<languages/lua/t/closure.t> :
 
@@ -85,7 +83,7 @@
 
 C<y> variable is not different.
 
-=head1 Perl Compiler (deprecated)
+=head2 Perl Compiler (deprecated)
 
 This compiler is written in Perl5 :
 
@@ -125,7 +123,7 @@
 
 =back
 
-=head1 Lua Types
+=head2 Lua Types
 
 There are eight basic types in Lua, each of them is implemented by a PMC.
 
@@ -164,15 +162,15 @@
 
 F<languages/lua/src/pmc/lua.pmc> is a singleton PMC what holds some static methods.
 
-=head2 TODO
+=head3 TODO
 
 Arguments passing in C<invoke> method of C<table>. Where are there ?
 
-=head2 IMPROVEMENT
+=head3 IMPROVEMENT
 
 C<table> with a mixed array and hash (like Lua 5).
 
-=head1 Lua Standard Libraries
+=head2 Lua Standard Libraries
 
 Lua 5.1 defines the following standard libraries:
 
@@ -202,11 +200,11 @@
 
 F<languages/lua/src/lib/luaregex.pir> implements a regex compiler using PGE.
 
-=head2 TODO
+=head3 TODO
 
 Complete some of these libraries.
 
-=head1 Extension Libraries
+=head2 Extension Libraries
 
 These libraries are loaded dynamically with the Lua function C<require>.
 
@@ -242,16 +240,16 @@
 
 =back
 
-=head1 Next Milestones
+=head2 Next Milestones
 
 Debugging & stabilisation.
 
-=head2 FEEDBACK
+=head3 FEEDBACK
 
 I try to summarize all my feedback, here :
 L<http://www.nntp.perl.org/group/perl.perl6.internals/2007/10/msg40493.html>.
 
-=head1 Related Projects
+=head2 Related Projects
 
 Klaas-Jan Stol works on 2 projects :
 
@@ -269,7 +267,7 @@
 
 See L<http://kjs.home.fmf.nl/>.
 
-=head1 AUTHOR
+=head2 Author
 
 Francois Perrad.
 

Modified: branches/vtable_morph_change/languages/lua/src/pmc/lua.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/lua.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/lua.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -90,7 +90,7 @@
 */
     METHOD PMC* clock() {
         const FLOATVAL f = clock() / (FLOATVAL)CLOCKS_PER_SEC;
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, f);
         RETURN(PMC *retval);
     }

Modified: branches/vtable_morph_change/languages/lua/src/pmc/lua_private.h
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/lua_private.h	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/lua_private.h	Tue Feb 10 02:09:33 2009	(r36517)
@@ -18,7 +18,10 @@
 
 #define PMC_type(pmc)      ((pmc)->vtable->base_type)
 
-extern PMC * find_meth(PARROT_INTERP, PMC *obj, const char *name);
+extern PMC * _LuaAny_find_meth(PARROT_INTERP, PMC *obj, const char *name);
+extern PMC * _LuaString_get_metatable(PARROT_INTERP);
+extern PMC * _LuaTable_get_metatable(PARROT_INTERP, PMC *obj);
+extern PMC * _LuaUserdata_get_metatable(PARROT_INTERP, PMC *obj);
 
 #endif /* PARROT_LUA_PRIVATE_H_GUARD */
 

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luaany.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luaany.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luaany.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -53,36 +53,35 @@
 
 
 PMC *
-find_meth(PARROT_INTERP, PMC *obj, const char *name) {
-    PMC   *meta = NULL;
-    INTVAL type = PMC_type(obj);
+_LuaAny_find_meth(PARROT_INTERP, PMC *obj, const char *name) {
+    PMC *meta = NULL;
+    const INTVAL type = PMC_type(obj);
 
-    if (dynpmc_LuaString == type) {
-        meta = Parrot_find_global_s(interp,
-                                    Parrot_str_new_constant(interp, "string"),
-                                    Parrot_str_new_constant(interp, "mt_string"));
+    if (type == dynpmc_LuaTable) {
+        meta = _LuaTable_get_metatable(interp, obj);
+    }
+    else if (type == dynpmc_LuaUserdata) {
+        meta = _LuaUserdata_get_metatable(interp, obj);
+    }
+    else if (type == dynpmc_LuaString) {
+        meta = _LuaString_get_metatable(interp);
     }
 
-    if (dynpmc_LuaFunction != type) {
-        if (obj->pmc_ext)
-            meta = PMC_metadata(obj);
+    if (!meta)
+        return NULL;
 
-        if (meta && dynpmc_LuaTable != PMC_type(meta))
-            return meta;
+    if (dynpmc_LuaTable != PMC_type(meta)) {
+        return meta;
     }
-
-    if (meta) {
+    else {
         PMC *method;
-        PMC *key = pmc_new(interp, dynpmc_LuaString);
+        PMC * const key = pmc_new(interp, dynpmc_LuaString);
         VTABLE_set_string_native(interp, key, Parrot_str_new_constant(interp, name));
 
         method = VTABLE_get_pmc_keyed(interp, meta, key);
 
-        if (dynpmc_LuaNil != PMC_type(method))
-            return method;
+        return (dynpmc_LuaNil != PMC_type(method)) ? method : NULL;
     }
-
-    return NULL;
 }
 
 
@@ -155,12 +154,12 @@
 
 */
     VTABLE PMC* get_pmc_keyed(PMC *key) {
-        PMC * const meth = find_meth(INTERP, SELF, "__index");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__index");
 
         if (meth) {
             if (dynpmc_LuaFunction == PMC_type(meth)) {
-                PMC *retval = Parrot_runops_fromc_args(INTERP, meth, "PPP",
-                                                       SELF, key);
+                PMC * const retval = Parrot_runops_fromc_args(INTERP, meth, "PPP",
+                                                              SELF, key);
                 if (retval)
                     return retval;
 
@@ -184,7 +183,7 @@
 
 */
     VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__newindex");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__newindex");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -210,7 +209,7 @@
 
 */
     VTABLE PMC* neg(PMC *dest) {
-        PMC * const meth = find_meth(INTERP, SELF, "__unm");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__unm");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -225,7 +224,7 @@
     }
 
     VTABLE void i_neg() {
-        PMC * const  meth = find_meth(INTERP, SELF, "__unm");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__unm");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -276,7 +275,7 @@
 
 */
     VTABLE opcode_t* invoke(void *next) {
-        PMC * const meth = find_meth(INTERP, SELF, "__call");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__call");
         PMC *retval;
 
         if (!meth)
@@ -285,13 +284,13 @@
 
             /* fix me */
 #if 1
-            retval = Parrot_runops_fromc_args(INTERP, meth, "PP", SELF);
-            if (!retval)
-                retval = pmc_new(INTERP, dynpmc_LuaNil);
+        retval = Parrot_runops_fromc_args(INTERP, meth, "PP", SELF);
+        if (!retval)
+            retval = pmc_new(INTERP, dynpmc_LuaNil);
 #else
-            next = VTABLE_invoke(INTERP, meth, next);
+        next = VTABLE_invoke(INTERP, meth, next);
 #endif
-            return (opcode_t *)next;
+        return (opcode_t *)next;
     }
 
 /*
@@ -336,7 +335,7 @@
 
 */
     MULTI PMC* add(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, SELF, "__add");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__add");
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
                 "attempt to perform arithmetic on a %Ss value", SELF.name());
@@ -350,7 +349,7 @@
     }
 
     MULTI void i_add(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__add");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__add");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -362,7 +361,7 @@
     }
 
     MULTI PMC* subtract(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, SELF, "__sub");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__sub");
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
                 "attempt to perform arithmetic on a %Ss value", SELF.name());
@@ -376,7 +375,7 @@
     }
 
     MULTI void i_subtract(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__sub");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__sub");
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
                 "attempt to perform arithmetic on a %Ss value", SELF.name());
@@ -388,7 +387,7 @@
     }
 
     MULTI PMC* multiply(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, SELF, "__mul");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__mul");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -403,7 +402,7 @@
     }
 
     MULTI void i_multiply(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__mul");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__mul");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -416,7 +415,7 @@
     }
 
     MULTI PMC* divide(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, SELF, "__div");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__div");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -431,7 +430,7 @@
     }
 
     MULTI void i_divide(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__div");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__div");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -444,7 +443,7 @@
     }
 
     MULTI PMC* modulus(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, SELF, "__mod");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__mod");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -459,7 +458,7 @@
     }
 
     MULTI void i_modulus(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__mod");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__mod");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -472,7 +471,7 @@
     }
 
     MULTI PMC* pow(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, SELF, "__pow");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__pow");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -487,7 +486,7 @@
     }
 
     MULTI void i_pow(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__pow");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__pow");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -500,7 +499,7 @@
     }
 
     MULTI PMC* concatenate(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, SELF, "__concat");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__concat");
 
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
@@ -515,7 +514,7 @@
     }
 
     MULTI void i_concatenate(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__concat");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__concat");
         if (!meth)
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_ILL_INHERIT,
                 "attempt to concatenate a %Ss value", SELF.name());
@@ -580,7 +579,7 @@
 
 */
     METHOD PMC* get_metatable() {
-        PMC *nil = pmc_new(INTERP, dynpmc_LuaNil);
+        PMC * const nil = pmc_new(INTERP, dynpmc_LuaNil);
         RETURN(PMC *nil);
     }
 
@@ -593,7 +592,7 @@
 
 */
     METHOD PMC* len() {
-        PMC * const meth = find_meth(INTERP, SELF, "__len");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__len");
         PMC *retval;
 
         if (!meth)
@@ -618,7 +617,7 @@
 
 */
     METHOD PMC* tonumber() {
-        PMC *nil = pmc_new(INTERP, dynpmc_LuaNil);
+        PMC * const nil = pmc_new(INTERP, dynpmc_LuaNil);
         RETURN(PMC *nil);
     }
 
@@ -634,7 +633,7 @@
 
 */
     METHOD PMC* tostring() {
-        PMC * const meth = find_meth(INTERP, SELF, "__tostring");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__tostring");
         PMC *retval;
 
         if (meth) {

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luaboolean.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luaboolean.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luaboolean.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -240,8 +240,7 @@
 
 */
     MULTI INTVAL is_equal(LuaBoolean value) {
-        return (VTABLE_get_integer(INTERP, SELF)
-            ==  VTABLE_get_integer(INTERP, value));
+        return (INTVAL)(VTABLE_get_integer(INTERP, SELF) == VTABLE_get_integer(INTERP, value));
     }
 
     MULTI INTVAL is_equal(DEFAULT value) {
@@ -262,14 +261,11 @@
 
 */
     METHOD PMC* rawequal(PMC *value) {
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
-
-        if (PMC_type(SELF) == PMC_type(value)
-         && VTABLE_get_integer(INTERP, SELF) == VTABLE_get_integer(INTERP, value))
-            VTABLE_set_integer_native(INTERP, retval, 1);
-        else
-            VTABLE_set_integer_native(INTERP, retval, 0);
-
+        const INTVAL b = (PMC_type(SELF) == PMC_type(value)
+            && VTABLE_get_integer(INTERP, SELF) == VTABLE_get_integer(INTERP, value))
+                         ? 1 : 0;
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        VTABLE_set_integer_native(INTERP, retval, b);
         RETURN(PMC *retval);
     }
 

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luabytecode.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luabytecode.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luabytecode.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -122,10 +122,10 @@
 
 static PMC * _new_lua(Interp *interp, const char *name)
 {
-    PMC * key = key_append(interp,
+    PMC * const key = key_append(interp,
           key_new_cstring(interp, "Lua"),
           key_new_cstring(interp, name));
-    PMC * class_object = Parrot_oo_get_class(interp, key);
+    PMC * const class_object = Parrot_oo_get_class(interp, key);
     if (class_object == PMCNULL)
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ILL_INHERIT,
               "Lua::%s not loaded", name);
@@ -136,7 +136,7 @@
 
 static PMC* _load_bool(Interp *interp)
 {
-    PMC* ret = pmc_new(interp, pmc_type(interp,
+    PMC* const ret = pmc_new(interp, pmc_type(interp,
           Parrot_str_new_constant(interp, "Boolean")));
     VTABLE_set_integer_native(interp, ret, _get_byte());
     return ret;
@@ -144,7 +144,7 @@
 
 static PMC* _load_byte(Interp *interp)
 {
-    PMC* ret = pmc_new(interp, pmc_type(interp,
+    PMC* const ret = pmc_new(interp, pmc_type(interp,
           Parrot_str_new_constant(interp, "Integer")));
     VTABLE_set_integer_native(interp, ret, _get_byte());
     return ret;
@@ -152,7 +152,7 @@
 
 static PMC* _load_integer(Interp *interp)
 {
-    PMC* ret = pmc_new(interp, pmc_type(interp,
+    PMC* const ret = pmc_new(interp, pmc_type(interp,
           Parrot_str_new_constant(interp, "Integer")));
     VTABLE_set_integer_native(interp, ret, _get_integer());
     return ret;
@@ -160,7 +160,7 @@
 
 static PMC* _load_string(Interp *interp)
 {
-    PMC* ret = pmc_new(interp, pmc_type(interp,
+    PMC* const ret = pmc_new(interp, pmc_type(interp,
           Parrot_str_new_constant(interp, "String")));
     VTABLE_set_string_native(interp, ret, _get_string(interp));
     return ret;
@@ -199,8 +199,8 @@
 static PMC* _load_instruction_list(Interp *interp)
 {
     int i;
-    int n = _get_integer();
-    PMC * ret = _new_lua(interp, "InstructionList");
+    const int n = _get_integer();
+    PMC * const ret = _new_lua(interp, "InstructionList");
     VTABLE_set_integer_native(interp, ret, n);
 
     for (i = 0; i < n; i++) {
@@ -213,13 +213,13 @@
 static PMC* _load_constant_list(Interp *interp)
 {
     int i;
-    int n = _get_integer();
-    PMC * ret = _new_lua(interp, "ConstantList");
+    const int n = _get_integer();
+    PMC * const ret = _new_lua(interp, "ConstantList");
     VTABLE_set_integer_native(interp, ret, n);
 
     for (i = 0; i < n; i++) {
         PMC* k;
-        int type = _get_byte();
+        const int type = _get_byte();
         switch (type) {
         case 0:
             k = _new_lua(interp, "Nil");
@@ -248,8 +248,8 @@
 static PMC* _load_prototype_list(Interp *interp)
 {
     int i;
-    int n = _get_integer();
-    PMC * ret = _new_lua(interp, "PrototypeList");
+    const int n = _get_integer();
+    PMC * const ret = _new_lua(interp, "PrototypeList");
     VTABLE_set_integer_native(interp, ret, n);
 
     for (i = 0; i < n; i++) {
@@ -262,8 +262,8 @@
 static PMC* _load_line_list(Interp *interp)
 {
     int i;
-    int n = _get_integer();
-    PMC * ret = _new_lua(interp, "LineList");
+    const int n = _get_integer();
+    PMC * const ret = _new_lua(interp, "LineList");
     VTABLE_set_integer_native(interp, ret, n);
 
     for (i = 0; i < n; i++) {
@@ -276,12 +276,12 @@
 static PMC* _load_local_list(Interp *interp)
 {
     int i;
-    int n = _get_integer();
-    PMC * ret = _new_lua(interp, "LocalList");
+    const int n = _get_integer();
+    PMC * const ret = _new_lua(interp, "LocalList");
     VTABLE_set_integer_native(interp, ret, n);
 
     for (i = 0; i < n; i++) {
-        PMC* local = _new_lua(interp, "Local");
+        PMC* const local = _new_lua(interp, "Local");
         VTABLE_set_string_native(interp, local, _get_string(interp));
         VTABLE_set_attr_str(interp, local,
             Parrot_str_new_constant(interp, "startpc"), _load_integer(interp));
@@ -296,12 +296,12 @@
 static PMC* _load_upvalue_list(Interp *interp)
 {
     int i;
-    int n = _get_integer();
-    PMC * ret = _new_lua(interp, "UpvalueList");
+    const int n = _get_integer();
+    PMC * const ret = _new_lua(interp, "UpvalueList");
     VTABLE_set_integer_native(interp, ret, n);
 
     for (i = 0; i < n; i++) {
-        PMC* upvalue = _new_lua(interp, "Upvalue");
+        PMC* const upvalue = _new_lua(interp, "Upvalue");
         VTABLE_set_string_native(interp, upvalue, _get_string(interp));
         VTABLE_set_pmc_keyed_int(interp, ret, i, upvalue);
     }
@@ -311,7 +311,7 @@
 
 static PMC* _load_function(Interp *interp)
 {
-    PMC * ret = _new_lua(interp, "Function");
+    PMC * const ret = _new_lua(interp, "Function");
 
     VTABLE_set_attr_str(interp, ret,
         Parrot_str_new_constant(interp, "source"), _load_string(interp));
@@ -379,7 +379,7 @@
 
 */
     METHOD PMC* undump(STRING* luabytecode) {
-        PMC * script = _new_lua(INTERP, "Bytecode");
+        PMC * const script = _new_lua(INTERP, "Bytecode");
 
         _init(INTERP, luabytecode);
         _load_header(INTERP, script);

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luafunction.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luafunction.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luafunction.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -153,7 +153,7 @@
 */
     METHOD STRING *get_name() {
         const Parrot_sub * const sub = PMC_sub(SELF);
-        STRING *retval = Parrot_str_copy(INTERP, sub->name);
+        STRING * const retval = Parrot_str_copy(INTERP, sub->name);
         RETURN(STRING *retval);
     }
 
@@ -181,15 +181,12 @@
 
 */
     METHOD PMC* rawequal(PMC *value) {
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
-
-        if (PMC_type(SELF)             == PMC_type(value)
-        && (PMC_sub(SELF))->start_offs == (PMC_sub(value))->start_offs
-        && (PMC_sub(SELF))->seg        == (PMC_sub(value))->seg)
-            VTABLE_set_integer_native(INTERP, retval, 1);
-        else
-            VTABLE_set_integer_native(INTERP, retval, 0);
-
+        const INTVAL b = (PMC_type(SELF) == PMC_type(value)
+          && (PMC_sub(SELF))->start_offs == (PMC_sub(value))->start_offs
+                 && (PMC_sub(SELF))->seg == (PMC_sub(value))->seg)
+                         ? 1 : 0;
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        VTABLE_set_integer_native(INTERP, retval, b);
         RETURN(PMC *retval);
     }
 

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luanil.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luanil.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luanil.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -81,7 +81,7 @@
 
 */
     VTABLE PMC* clone() {
-        PMC *dest = pmc_new(INTERP, PMC_type(SELF));
+        PMC * const dest = pmc_new(INTERP, PMC_type(SELF));
         STRUCT_COPY(&PMC_union(dest), &PMC_union(SELF));
         return dest;
     }
@@ -160,12 +160,9 @@
 
 */
     METHOD PMC *rawequal(PMC *value) {
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
-        if (PMC_type(SELF) == PMC_type(value))
-            VTABLE_set_integer_native(INTERP, retval, 1);
-        else
-            VTABLE_set_integer_native(INTERP, retval, 0);
-
+        const INTVAL b = (PMC_type(SELF) == PMC_type(value)) ? 1 : 0;
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        VTABLE_set_integer_native(INTERP, retval, b);
         RETURN(PMC *retval);
     }
 

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luanumber.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luanumber.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luanumber.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -115,7 +115,7 @@
 */
     VTABLE PMC *clone() {
         FLOATVAL fv;
-        PMC *dest = pmc_new(INTERP, PMC_type(SELF));
+        PMC * const dest = pmc_new(INTERP, PMC_type(SELF));
         GET_ATTR_fv(INTERP, SELF, fv);
         SET_ATTR_fv(INTERP, dest, fv);
         return dest;
@@ -325,7 +325,7 @@
     }
 
     MULTI PMC *add(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -338,7 +338,7 @@
     }
 
     MULTI PMC *add(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__add");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__add");
 
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -367,7 +367,7 @@
     }
 
     MULTI void i_add(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -380,7 +380,7 @@
     }
 
     MULTI void i_add(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__add");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__add");
 
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -411,7 +411,7 @@
     }
 
     MULTI PMC *subtract(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -424,7 +424,7 @@
     }
 
     MULTI PMC *subtract(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__sub");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__sub");
 
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -454,7 +454,7 @@
     }
 
     MULTI void i_subtract(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -467,7 +467,7 @@
     }
 
     MULTI void i_subtract(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__sub");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__sub");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (! SELF)
@@ -497,7 +497,7 @@
     }
 
     MULTI PMC *multiply(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -510,7 +510,7 @@
     }
 
     MULTI PMC *multiply(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__mul");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__mul");
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(dest))
@@ -537,7 +537,7 @@
     }
 
     MULTI void i_multiply(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -550,7 +550,7 @@
     }
 
     MULTI void i_multiply(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__mul");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__mul");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (! SELF)
@@ -580,7 +580,7 @@
     }
 
     MULTI PMC *divide(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -593,7 +593,7 @@
     }
 
     MULTI PMC *divide(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__div");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__div");
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(dest))
@@ -621,7 +621,7 @@
     }
 
     MULTI void i_divide(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -634,7 +634,7 @@
     }
 
     MULTI void i_divide(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__div");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__div");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (! SELF)
@@ -665,7 +665,7 @@
     }
 
     MULTI PMC *modulus(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                "->P", &n);
 
@@ -678,7 +678,7 @@
     }
 
     MULTI PMC *modulus(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__mod");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__mod");
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(dest))
@@ -707,7 +707,7 @@
     }
 
     MULTI void i_modulus(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -720,7 +720,7 @@
     }
 
     MULTI void i_modulus(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__mod");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__mod");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (! SELF)
@@ -750,7 +750,7 @@
     }
 
     MULTI PMC *pow(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -763,7 +763,7 @@
     }
 
     MULTI PMC *pow(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__pow");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__pow");
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(dest))
@@ -791,7 +791,7 @@
     }
 
     MULTI void i_pow(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, value, Parrot_str_new_constant(interp, "tonumber"),
                 "->P", &n);
 
@@ -804,7 +804,7 @@
     }
 
     MULTI void i_pow(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__pow");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__pow");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (! SELF)
@@ -858,7 +858,7 @@
 =cut
 
 */
-    MULTI PMC *concatenate(LuaNumber value,  PMC *dest) {
+    MULTI PMC *concatenate(LuaNumber value, PMC *dest) {
         STRING * const s = Parrot_str_concat(INTERP, SELF.get_string(),
             VTABLE_get_string(INTERP, value), 0);
         dest = pmc_new(INTERP, dynpmc_LuaNumber);
@@ -866,7 +866,7 @@
         return dest;
     }
 
-    MULTI PMC *concatenate(LuaString value,  PMC *dest) {
+    MULTI PMC *concatenate(LuaString value, PMC *dest) {
         STRING * const s = Parrot_str_concat(INTERP, SELF.get_string(),
             VTABLE_get_string(INTERP, value), 0);
         dest = pmc_new(INTERP, dynpmc_LuaNumber);
@@ -874,8 +874,8 @@
         return dest;
     }
 
-    MULTI PMC *concatenate(DEFAULT value,  PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__concat");
+    MULTI PMC *concatenate(DEFAULT value, PMC *dest) {
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__concat");
 
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -911,7 +911,7 @@
     }
 
     MULTI void i_concatenate(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__concat");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__concat");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
 
@@ -941,7 +941,7 @@
 */
     METHOD PMC* acosh() {
         const FLOATVAL n = acosh(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -955,7 +955,7 @@
 */
     METHOD PMC* asinh() {
         const FLOATVAL n = asinh(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -969,7 +969,7 @@
 */
     METHOD PMC* atanh() {
         const FLOATVAL n = atanh(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -983,7 +983,7 @@
 */
     METHOD PMC* cbrt() {
         const FLOATVAL n = cbrt(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -998,7 +998,7 @@
     METHOD PMC* copysign(PMC* y) {
         const FLOATVAL n = copysign(VTABLE_get_number(INTERP, SELF),
                                     VTABLE_get_number(INTERP, y));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1012,7 +1012,7 @@
 */
     METHOD PMC* erf() {
         const FLOATVAL n = erf(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1026,7 +1026,7 @@
 */
     METHOD PMC* erfc() {
         const FLOATVAL n = erfc(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1040,7 +1040,7 @@
 */
     METHOD PMC* exp2() {
         const FLOATVAL n = exp2(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1054,7 +1054,7 @@
 */
     METHOD PMC* expm1() {
         const FLOATVAL n = expm1(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1069,7 +1069,7 @@
     METHOD PMC* fdim(PMC* y) {
         const FLOATVAL n = fdim(VTABLE_get_number(INTERP, SELF),
                                 VTABLE_get_number(INTERP, y));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1085,7 +1085,7 @@
         const FLOATVAL n = fma(VTABLE_get_number(INTERP, SELF),
                                VTABLE_get_number(INTERP, y),
                                VTABLE_get_number(INTERP, z));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1100,7 +1100,7 @@
     METHOD PMC* fmax(PMC* y) {
         const FLOATVAL n = fmax(VTABLE_get_number(INTERP, SELF),
                                 VTABLE_get_number(INTERP, y));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1115,7 +1115,7 @@
     METHOD PMC* fmin(PMC* y) {
         const FLOATVAL n = fmin(VTABLE_get_number(INTERP, SELF),
                                 VTABLE_get_number(INTERP, y));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1128,7 +1128,7 @@
 
 */
     METHOD PMC* fpclassify() {
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaString);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaString);
         const char *p;
         switch (fpclassify(VTABLE_get_number(INTERP, SELF))) {
         case FP_INFINITE:       p = "inf";              break;
@@ -1151,14 +1151,14 @@
 
 */
     METHOD PMC* frexp() {
-        PMC *y      = pmc_new(INTERP, dynpmc_LuaNumber);
-        PMC *expn   = pmc_new(INTERP, dynpmc_LuaNumber);
-        PMC *retval = pmc_new(INTERP, enum_class_Array);
-        int  e;
-
-        VTABLE_set_number_native(INTERP, y,
-                                 frexp(VTABLE_get_number(INTERP, SELF), &e));
-        VTABLE_set_integer_native(INTERP, expn, e);
+        int _e;
+        const FLOATVAL _y  = frexp(VTABLE_get_number(INTERP, SELF), &_e);
+        PMC * const y      = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const expn   = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, enum_class_Array);
+
+        VTABLE_set_number_native(INTERP, y, _y);
+        VTABLE_set_integer_native(INTERP, expn, _e);
         VTABLE_set_integer_native(INTERP, retval, 2);
         VTABLE_set_pmc_keyed_int(INTERP, retval, 0, y);
         VTABLE_set_pmc_keyed_int(INTERP, retval, 1, expn);
@@ -1176,7 +1176,7 @@
     METHOD PMC* hypot(PMC* y) {
         const FLOATVAL n = hypot(VTABLE_get_number(INTERP, SELF),
                                  VTABLE_get_number(INTERP, y));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1190,7 +1190,7 @@
 */
     METHOD PMC* ilogb() {
         const FLOATVAL n = ilogb(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1204,7 +1204,7 @@
 */
     METHOD PMC* isfinite() {
         const INTVAL b = isfinite(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
         VTABLE_set_bool(INTERP, retval, b);
         RETURN(PMC *retval);
     }
@@ -1218,7 +1218,7 @@
 */
     METHOD PMC* isinf() {
         const INTVAL b = isinf(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
         VTABLE_set_bool(INTERP, retval, b);
         RETURN(PMC *retval);
     }
@@ -1232,7 +1232,7 @@
 */
     METHOD PMC* isnan() {
         const INTVAL b = isnan(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
         VTABLE_set_bool(INTERP, retval, b);
         RETURN(PMC *retval);
     }
@@ -1246,7 +1246,7 @@
 */
     METHOD PMC* isnormal() {
         const INTVAL b = isnormal(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
         VTABLE_set_bool(INTERP, retval, b);
         RETURN(PMC *retval);
     }
@@ -1261,7 +1261,7 @@
     METHOD PMC* ldexp(PMC *expn) {
         const FLOATVAL n = ldexp(VTABLE_get_number(INTERP, SELF),
                                  VTABLE_get_integer(INTERP, expn));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1275,7 +1275,7 @@
 */
     METHOD PMC* lgamma() {
         const FLOATVAL n = lgamma(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1289,7 +1289,7 @@
 */
     METHOD PMC* log1p() {
         const FLOATVAL n = log1p(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1303,7 +1303,7 @@
 */
     METHOD PMC* log2() {
         const FLOATVAL n = log2(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1317,7 +1317,7 @@
 */
     METHOD PMC* logb() {
         const FLOATVAL n = logb(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1330,13 +1330,13 @@
 
 */
     METHOD PMC* modf() {
-        PMC     *y      = pmc_new(INTERP, dynpmc_LuaNumber);
-        PMC     *d      = pmc_new(INTERP, dynpmc_LuaNumber);
-        PMC     *retval = pmc_new(INTERP, enum_class_Array);
         FLOATVAL _d;
+        const FLOATVAL _y  = modf(VTABLE_get_number(INTERP, SELF), &_d);
+        PMC * const y      = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const d      = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, enum_class_Array);
 
-        VTABLE_set_number_native(INTERP, y,
-                                 modf(VTABLE_get_number(INTERP, SELF), &_d));
+        VTABLE_set_number_native(INTERP, y, _y);
         VTABLE_set_number_native(INTERP, d, _d);
         VTABLE_set_integer_native(INTERP, retval, 2);
         VTABLE_set_pmc_keyed_int(INTERP, retval, 0, d);
@@ -1354,7 +1354,7 @@
 */
     METHOD PMC* nearbyint() {
         const FLOATVAL n = nearbyint(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1369,7 +1369,7 @@
     METHOD PMC* nextafter(PMC* y) {
         const FLOATVAL n = nextafter(VTABLE_get_number(INTERP, SELF),
                                      VTABLE_get_number(INTERP, y));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1384,7 +1384,7 @@
     METHOD PMC* nexttoward(PMC* y) {
         const FLOATVAL n = nexttoward(VTABLE_get_number(INTERP, SELF),
                                       VTABLE_get_number(INTERP, y));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1397,14 +1397,11 @@
 
 */
     METHOD PMC *rawequal(PMC *value) {
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
-
-        if (PMC_type(SELF) == PMC_type(value)
-        &&  VTABLE_get_number(INTERP, SELF) == VTABLE_get_number(INTERP, value))
-            VTABLE_set_integer_native(INTERP, retval, 1);
-        else
-            VTABLE_set_integer_native(INTERP, retval, 0);
-
+        const INTVAL b = (PMC_type(SELF) == PMC_type(value)
+            && VTABLE_get_number(INTERP, SELF) == VTABLE_get_number(INTERP, value))
+                         ? 1 : 0;
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        VTABLE_set_integer_native(INTERP, retval, b);
         RETURN(PMC *retval);
     }
 
@@ -1418,7 +1415,7 @@
     METHOD PMC* remainder(PMC* y) {
         const FLOATVAL n = remainder(VTABLE_get_number(INTERP, SELF),
                                      VTABLE_get_number(INTERP, y));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1432,7 +1429,7 @@
 */
     METHOD PMC* rint() {
         const FLOATVAL n = rint(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1446,7 +1443,7 @@
 */
     METHOD PMC* round() {
         const FLOATVAL n = round(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1461,7 +1458,7 @@
     METHOD PMC* scalbn(PMC* ex) {
         const FLOATVAL n = scalbn(VTABLE_get_number(INTERP, SELF),
                                   VTABLE_get_number(INTERP, ex));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1475,7 +1472,7 @@
 */
     METHOD PMC* signbit() {
         const FLOATVAL n = signbit(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1489,7 +1486,7 @@
 */
     METHOD PMC* tgamma() {
         const FLOATVAL n = tgamma(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1503,7 +1500,7 @@
 */
     METHOD PMC* trunc() {
         const FLOATVAL n = trunc(VTABLE_get_number(INTERP, SELF));
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, n);
         RETURN(PMC *retval);
     }
@@ -1516,7 +1513,7 @@
 
 */
     METHOD PMC *tonumber() {
-        PMC *clone = SELF.clone();
+        PMC * const clone = SELF.clone();
         RETURN(PMC *clone);
     }
 

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luastring.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luastring.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luastring.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -22,6 +22,13 @@
 #include "lua_private.h"
 #include "pmc_luanumber.h"
 
+PMC *
+_LuaString_get_metatable(PARROT_INTERP) {
+    return Parrot_find_global_s(interp,
+                                Parrot_str_new_constant(interp, "string"),
+                                Parrot_str_new_constant(interp, "mt_string"));
+}
+
 
 pmclass LuaString
     extends  LuaAny
@@ -188,7 +195,7 @@
 
 */
     VTABLE PMC* neg(PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -207,7 +214,7 @@
 
 */
     VTABLE void i_neg() {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -276,7 +283,7 @@
 
 */
     MULTI PMC* add(LuaNumber value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -288,7 +295,7 @@
     }
 
     MULTI PMC* add(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -300,7 +307,7 @@
     }
 
     MULTI PMC* add(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__add");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__add");
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(dest))
@@ -322,7 +329,7 @@
 
 */
     MULTI void i_add(LuaNumber value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -335,7 +342,7 @@
     }
 
     MULTI void i_add(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -348,7 +355,7 @@
     }
 
     MULTI void i_add(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__add");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__add");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(SELF))
@@ -370,7 +377,7 @@
 
 */
     MULTI PMC* subtract(LuaNumber value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -382,7 +389,7 @@
     }
 
     MULTI PMC* subtract(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -394,7 +401,7 @@
     }
 
     MULTI PMC* subtract(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__sub");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__sub");
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(dest))
@@ -416,7 +423,7 @@
 
 */
     MULTI void i_subtract(LuaNumber value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -429,7 +436,7 @@
     }
 
     MULTI void i_subtract(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -442,7 +449,7 @@
     }
 
     MULTI void i_subtract(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__sub");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__sub");
 
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -465,7 +472,7 @@
 
 */
     MULTI PMC* multiply(LuaNumber value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -477,7 +484,7 @@
     }
 
     MULTI PMC* multiply(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -489,7 +496,7 @@
     }
 
     MULTI PMC* multiply(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__mul");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__mul");
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(dest))
@@ -511,7 +518,7 @@
 
 */
     MULTI void i_multiply(LuaNumber value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -524,7 +531,7 @@
     }
 
     MULTI void i_multiply(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -537,7 +544,7 @@
     }
 
     MULTI void i_multiply(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__mul");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__mul");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(SELF))
@@ -559,7 +566,7 @@
 
 */
     MULTI PMC* divide(LuaNumber value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -571,7 +578,7 @@
     }
 
     MULTI PMC* divide(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -583,7 +590,7 @@
     }
 
     MULTI PMC* divide(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__div");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__div");
 
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -606,7 +613,7 @@
 
 */
     MULTI void i_divide(LuaNumber value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -619,7 +626,7 @@
     }
 
     MULTI void i_divide(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -632,7 +639,7 @@
     }
 
     MULTI void i_divide(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__div");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__div");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(SELF))
@@ -654,7 +661,7 @@
 
 */
     MULTI PMC* modulus(LuaNumber value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -666,7 +673,7 @@
     }
 
     MULTI PMC* modulus(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -678,7 +685,7 @@
     }
 
     MULTI PMC* modulus(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__mod");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__mod");
 
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -701,7 +708,7 @@
 
 */
     MULTI void i_modulus(LuaNumber value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -714,7 +721,7 @@
     }
 
     MULTI void i_modulus(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -727,7 +734,7 @@
     }
 
     MULTI void i_modulus(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__mod");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__mod");
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
             if (PMC_IS_NULL(SELF))
@@ -749,7 +756,7 @@
 
 */
     MULTI PMC* pow(LuaNumber value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -761,7 +768,7 @@
     }
 
     MULTI PMC* pow(LuaString value, PMC *dest) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -773,7 +780,7 @@
     }
 
     MULTI PMC* pow(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__pow");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__pow");
 
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -796,7 +803,7 @@
 
 */
     MULTI void i_pow(LuaNumber value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -809,7 +816,7 @@
     }
 
     MULTI void i_pow(LuaString value) {
-        PMC *n;
+        PMC * const n;
         Parrot_PCCINVOKE(interp, SELF, Parrot_str_new_constant(interp, "tonumber"),
             "->P", &n);
 
@@ -822,7 +829,7 @@
     }
 
     MULTI void i_pow(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__pow");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__pow");
 
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -850,7 +857,7 @@
     MULTI INTVAL is_equal(LuaString value) {
         STRING * const s = SELF.get_string();
         STRING * const v = VTABLE_get_string(INTERP, value);
-        return (INTVAL)(0 == Parrot_str_not_equal(INTERP, s, v));
+        return Parrot_str_equal(INTERP, s, v);
     }
 
     MULTI INTVAL is_equal(DEFAULT value) {
@@ -908,7 +915,7 @@
     }
 
     MULTI PMC* concatenate(DEFAULT value, PMC *dest) {
-        PMC * const meth = find_meth(INTERP, value, "__concat");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__concat");
 
         if (meth) {
             dest = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -943,7 +950,7 @@
     }
 
     MULTI void i_concatenate(DEFAULT value) {
-        PMC * const meth = find_meth(INTERP, value, "__concat");
+        PMC * const meth = _LuaAny_find_meth(INTERP, value, "__concat");
 
         if (meth) {
             SELF = Parrot_runops_fromc_args(INTERP, meth, "PPP", SELF, value);
@@ -972,9 +979,8 @@
 
 */
     METHOD PMC* get_metatable() {
-        PMC *retval = Parrot_find_global_s(INTERP,
-                             Parrot_str_new_constant(INTERP, "string"),
-                             Parrot_str_new_constant(INTERP, "mt_string"));
+        PMC *retval = _LuaString_get_metatable(INTERP);
+
         if (!retval)
             retval = pmc_new(INTERP, dynpmc_LuaNil);
 
@@ -990,7 +996,7 @@
 
 */
     METHOD PMC* len() {
-        PMC *retval         = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaNumber);
         VTABLE_set_number_native(INTERP, retval, SELF.elements());
         RETURN(PMC *retval);
     }

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luatable.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luatable.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luatable.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -23,6 +23,11 @@
 
 #include "lua_private.h"
 
+PMC *
+_LuaTable_get_metatable(PARROT_INTERP, PMC *obj) {
+    return PMC_metadata(obj);
+}
+
 #define LUA_ASSERT(c, s)         assert(((void)(s), (c)))
 
 #define PMC_hash(s) (LuaHash *)PMC_struct_val((s))
@@ -396,12 +401,12 @@
 */
     VTABLE void mark() {
         STRING *mode = NULL;
-        PMC    *meta = PMC_metadata(SELF);
+        PMC * const meta = PMC_metadata(SELF);
 
         if (meta) {
             PMC **m;
 #if 0
-            PMC *key = pmc_new(INTERP, dynpmc_LuaString);
+            PMC * const key = pmc_new(INTERP, dynpmc_LuaString);
             VTABLE_set_string_native(INTERP, key,
                     Parrot_str_new_constant(INTERP, "__mode"));
             m = lua_get(INTERP, PMC_hash(meta), key);
@@ -508,7 +513,7 @@
         if (pvalue)
             value = *pvalue;
         else {
-            PMC * const meth = find_meth(INTERP, SELF, "__index");
+            PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__index");
             if (meth) {
                 if (dynpmc_LuaFunction == PMC_type(meth)) {
                     value = Parrot_runops_fromc_args(INTERP, meth, "PPP",
@@ -536,7 +541,7 @@
 */
     VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
         if (! lua_get(INTERP, PMC_hash(SELF), key)) {
-            PMC * const meth = find_meth(INTERP, SELF, "__newindex");
+            PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__newindex");
             if (meth) {
                 if (dynpmc_LuaFunction == PMC_type(meth)) {
                     Parrot_runops_fromc_args(INTERP, meth, "vPPP", SELF,
@@ -570,7 +575,7 @@
 
 */
     VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) {
-        PMC * pmc_key = pmc_new(INTERP, dynpmc_LuaString);
+        PMC * const pmc_key = pmc_new(INTERP, dynpmc_LuaString);
         VTABLE_set_string_native(INTERP, pmc_key, Parrot_str_copy(INTERP, key));
         value = VTABLE_clone(interp, value);
         *lua_set(INTERP, PMC_hash(SELF), pmc_key) = value;
@@ -605,10 +610,10 @@
 
 */
     MULTI INTVAL is_equal(LuaTable value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__eq");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__eq");
         if (meth) {
-            PMC *retval = Parrot_runops_fromc_args(INTERP, meth, "PPP",
-                                                   SELF, value);
+            PMC * const retval = Parrot_runops_fromc_args(INTERP, meth, "PPP",
+                                                          SELF, value);
 
             if (PMC_IS_NULL(retval))
                 return (INTVAL)0;
@@ -616,10 +621,7 @@
             return VTABLE_get_bool(INTERP, retval);
         }
 
-        if (SELF == value)
-            return (INTVAL)1;
-        else
-            return (INTVAL)0;
+        return (SELF == value) ? (INTVAL)1 : (INTVAL)0;
     }
 
     MULTI INTVAL is_equal(DEFAULT value) {
@@ -635,16 +637,16 @@
 */
     MULTI INTVAL cmp(LuaTable value) {
 #if 0
-        PMC * const meth = find_meth(INTERP, SELF, "__cmp");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__cmp");
         if (meth) {
-            PMC *retval = Parrot_runops_fromc_args(INTERP, meth, "PPP",
-                                                   SELF, value);
+            PMC * const retval = Parrot_runops_fromc_args(INTERP, meth, "PPP",
+                                                          SELF, value);
 
             if (retval)
                 return (INTVAL)VTABLE_get_number(INTERP, retval);
         }
 #else
-        PMC * const _lt = find_meth(INTERP, SELF, "__lt");
+        PMC * const _lt = _LuaAny_find_meth(INTERP, SELF, "__lt");
 
         if (_lt) {
             PMC *retval = Parrot_runops_fromc_args(INTERP, _lt, "PPP",
@@ -654,7 +656,7 @@
             if (r)
                 return (INTVAL)-1;
             else {
-                PMC * const _le = find_meth(INTERP, SELF, "__le");
+                PMC * const _le = _LuaAny_find_meth(INTERP, SELF, "__le");
                 if (_le) {
                     retval = Parrot_runops_fromc_args(INTERP, _le, "PPP",
                                                       SELF, value);
@@ -704,7 +706,7 @@
 
 */
     METHOD PMC* get_metatable() {
-        PMC *retval = PMC_metadata(SELF);
+        PMC *retval = _LuaUserdata_get_metatable(INTERP, SELF);
 
         if (!retval)
             retval = pmc_new(INTERP, dynpmc_LuaNil);
@@ -720,8 +722,8 @@
 
 */
     METHOD PMC* len() {
-        PMC   **pvalue;
-        PMC   *key = pmc_new(INTERP, dynpmc_LuaNumber);
+        PMC **pvalue;
+        PMC * const key = pmc_new(INTERP, dynpmc_LuaNumber);
         INTVAL idx = 1;
 
         VTABLE_set_integer_native(INTERP, key, idx);
@@ -746,17 +748,17 @@
 
 */
     METHOD PMC* next(PMC* index) {
-        Node *n = lua_next(INTERP, PMC_hash(SELF), index);
+        Node * const n = lua_next(INTERP, PMC_hash(SELF), index);
 
         if (n) {
-            PMC *retval = pmc_new(INTERP, enum_class_Array);
+            PMC * const retval = pmc_new(INTERP, enum_class_Array);
             VTABLE_set_integer_native(INTERP, retval, 2);
             VTABLE_set_pmc_keyed_int(INTERP, retval, 0, n->key);
             VTABLE_set_pmc_keyed_int(INTERP, retval, 1, n->val);
             RETURN(PMC *retval);
         }
         else {
-            PMC *retval = pmc_new(INTERP, dynpmc_LuaNil);
+            PMC * const retval = pmc_new(INTERP, dynpmc_LuaNil);
             RETURN(PMC *retval);
         }
 
@@ -770,8 +772,9 @@
 
 */
     METHOD PMC* rawequal(PMC *value) {
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
-        VTABLE_set_integer_native(INTERP, retval, (SELF == value) ? 1 : 0);
+        const INTVAL b = (SELF == value) ? 1 : 0;
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        VTABLE_set_integer_native(INTERP, retval, b);
         RETURN(PMC *retval);
     }
 

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luathread.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luathread.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luathread.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2005-2008, The Perl Foundation.
+Copyright (C) 2005-2009, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -22,15 +22,17 @@
 
 #include "lua_private.h"
 
+#define t_val(pmc) (PARROT_LUATHREAD(pmc))->val
+#define t_env(pmc) (PARROT_LUATHREAD(pmc))->env
+
 static PMC* curr_func(PARROT_INTERP) {
-    Parrot_Context *ctx = CONTEXT(interp);
-    PMC *sub = ctx->current_sub;
-    return sub;
+    Parrot_Context * const ctx = CONTEXT(interp);
+    return ctx->current_sub;
 }
 
 static PMC* getcurrenv(PARROT_INTERP) {
     PMC *env = NULL;
-    PMC *sub = curr_func(interp);
+    PMC * const sub = curr_func(interp);
     if (sub) {
         env = PMC_metadata(sub);
     }
@@ -45,6 +47,9 @@
     group lua_group
     hll lua {
 
+    ATTR PMC    *val;
+    ATTR PMC    *env;
+
 /*
 
 =item C<void init()>
@@ -67,20 +72,23 @@
 
 */
     VTABLE void init_pmc(PMC *sub) {
-        PMC *classobj = Parrot_oo_get_class_str(INTERP,
+        PMC * const classobj = Parrot_oo_get_class_str(INTERP,
                           Parrot_str_new_constant(INTERP, "Parrot::Coroutine"));
+        Parrot_LuaThread_attributes * const t =
+              mem_allocate_zeroed_typed(Parrot_LuaThread_attributes);
         PMC *init_args;
 
         if (PMC_IS_NULL(classobj))
             Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_GLOBAL_NOT_FOUND,
                            "Parrot::Coroutine not found");
 
+        PMC_data(SELF) = t;
         init_args = pmc_new(INTERP, enum_class_Hash);
         VTABLE_set_pmc_keyed_str(INTERP, init_args,
                                  Parrot_str_new_constant(INTERP, "initial_sub"), sub);
-        PMC_pmc_val(SELF) = VTABLE_instantiate(INTERP, classobj, init_args);
-        PMC_metadata(SELF) = getcurrenv(INTERP);
-        PObj_custom_mark_SET(SELF);
+        t_val(SELF) = VTABLE_instantiate(INTERP, classobj, init_args);
+        t_env(SELF) = getcurrenv(INTERP);
+        PObj_custom_mark_destroy_SETALL(SELF);
     }
 
 /*
@@ -93,10 +101,27 @@
 
 */
     VTABLE void mark() {
-        if (PMC_pmc_val(SELF))
-            pobject_lives(INTERP, (PObj *)PMC_pmc_val(SELF));
-        if (PMC_metadata(SELF))
-            pobject_lives(INTERP, (PObj *)PMC_metadata(SELF));
+        if (t_val(SELF))
+            pobject_lives(INTERP, (PObj *)t_val(SELF));
+        if (t_env(SELF))
+            pobject_lives(INTERP, (PObj *)t_env(SELF));
+    }
+
+/*
+
+=item C<void destroy()>
+
+Call finalizer and free the thread.
+
+=cut
+
+*/
+    VTABLE void destroy() {
+        Parrot_LuaThread_attributes *u = PARROT_LUATHREAD(SELF);
+        if (u) {
+            mem_sys_free(u);
+            PMC_data(SELF) = NULL;
+        }
     }
 
 /*
@@ -131,7 +156,7 @@
 
 */
     VTABLE PMC* get_attr_str(STRING *key) {
-        return PMC_pmc_val(SELF);
+        return t_val(SELF);
     }
 
 /*
@@ -153,7 +178,8 @@
 
 */
     VTABLE void set_pmc(PMC *value) {
-        PMC_pmc_val(SELF) = PMC_pmc_val(value);
+        t_val(SELF) = t_val(value);
+        t_env(SELF) = t_env(value);
     }
 
 /*
@@ -170,14 +196,11 @@
 
 */
     MULTI INTVAL is_equal(LuaThread value) {
-        if (SELF == value)
-            return (INTVAL)1;
-        else
-            return (INTVAL)0;
+        return (SELF == value) ? (INTVAL)1 : (INTVAL)0;
     }
 
     MULTI INTVAL is_equal(DEFAULT value) {
-            return (INTVAL)0;
+        return (INTVAL)0;
     }
 
 /*
@@ -194,7 +217,7 @@
 
 */
     METHOD PMC* getfenv() {
-        PMC *retval = PMC_metadata(SELF);
+        PMC *retval = t_env(SELF);
 
         if (!retval)
             retval = pmc_new(INTERP, dynpmc_LuaNil);
@@ -210,13 +233,10 @@
 
 */
     METHOD PMC* rawequal(PMC *value) {
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
-
-        if (PMC_type(SELF) == PMC_type(value) && SELF == value)
-            VTABLE_set_integer_native(INTERP, retval, 1);
-        else
-            VTABLE_set_integer_native(INTERP, retval, 0);
-
+        const INTVAL b = (PMC_type(SELF) == PMC_type(value) && SELF == value)
+                         ? 1 : 0;
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        VTABLE_set_integer_native(INTERP, retval, b);
         RETURN(PMC *retval);
     }
 
@@ -228,7 +248,7 @@
 
 */
     METHOD void setfenv(PMC *env) {
-        PMC_metadata(SELF) = env;
+        t_env(SELF) = env;
     }
 
 }

Modified: branches/vtable_morph_change/languages/lua/src/pmc/luauserdata.pmc
==============================================================================
--- branches/vtable_morph_change/languages/lua/src/pmc/luauserdata.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/lua/src/pmc/luauserdata.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -24,6 +24,11 @@
 #define u_val(pmc) (PARROT_LUAUSERDATA(pmc))->val
 #define u_env(pmc) (PARROT_LUAUSERDATA(pmc))->env
 
+PMC *
+_LuaUserdata_get_metatable(PARROT_INTERP, PMC *obj) {
+    return PMC_metadata(obj);
+}
+
 static PMC* curr_func(PARROT_INTERP) {
     Parrot_Context *sub_ctx = CONTEXT(interp)->caller_ctx;
     while (1) {
@@ -107,7 +112,7 @@
 */
     VTABLE void destroy() {
         Parrot_LuaUserdata_attributes *u = PARROT_LUAUSERDATA(SELF);
-        PMC * const meth = find_meth(INTERP, SELF, "__gc");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__gc");
 
         if (meth)
             (void)Parrot_runops_fromc_args(INTERP, meth, "vP", SELF);
@@ -205,7 +210,7 @@
 
 */
     MULTI INTVAL is_equal(LuaUserdata value) {
-        PMC * const meth = find_meth(INTERP, SELF, "__eq");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__eq");
         if (meth) {
             PMC *retval = Parrot_runops_fromc_args(INTERP, meth, "PPP",
                                                    SELF, value);
@@ -215,14 +220,11 @@
             return VTABLE_get_bool(INTERP, retval);
         }
 
-        if (SELF == value)
-            return (INTVAL)1;
-        else
-            return (INTVAL)0;
+        return (SELF == value) ? (INTVAL)1 : (INTVAL)0;
     }
 
     MULTI INTVAL is_equal(DEFAULT value) {
-            return (INTVAL)0;
+        return (INTVAL)0;
     }
 
 /*
@@ -234,7 +236,7 @@
 */
     MULTI INTVAL cmp(LuaUserdata value) {
 #if 0
-        PMC * const meth = find_meth(INTERP, SELF, "__cmp");
+        PMC * const meth = _LuaAny_find_meth(INTERP, SELF, "__cmp");
         if (meth) {
             PMC *retval = Parrot_runops_fromc_args(INTERP, meth, "PPP",
                                                    SELF, value);
@@ -243,7 +245,7 @@
                 return (INTVAL)VTABLE_get_number(INTERP, retval);
         }
 #else
-        PMC * const _lt = find_meth(INTERP, SELF, "__lt");
+        PMC * const _lt = _LuaAny_find_meth(INTERP, SELF, "__lt");
 
         if (_lt) {
             PMC *retval = Parrot_runops_fromc_args(INTERP, _lt, "PPP",
@@ -253,7 +255,7 @@
             if (r)
                 return (INTVAL)-1;
             else {
-                PMC * const _le = find_meth(INTERP, SELF, "__le");
+                PMC * const _le = _LuaAny_find_meth(INTERP, SELF, "__le");
                 if (_le) {
                     retval = Parrot_runops_fromc_args(INTERP, _le, "PPP",
                                                       SELF, value);
@@ -319,7 +321,7 @@
 
 */
     METHOD PMC* get_metatable() {
-        PMC *retval = PMC_metadata(SELF);
+        PMC *retval = _LuaUserdata_get_metatable(INTERP, SELF);
 
         if (!retval)
             retval = pmc_new(INTERP, dynpmc_LuaNil);
@@ -335,15 +337,12 @@
 
 */
     METHOD PMC* rawequal(PMC *value) {
-        PMC *retval = pmc_new(INTERP, dynpmc_LuaBoolean);
-
-        if (PMC_type(SELF) == PMC_type(value)
-        && u_val(SELF)     == u_val(value)
-        && u_env(SELF)     == u_env(value))
-            VTABLE_set_integer_native(INTERP, retval, 1);
-        else
-            VTABLE_set_integer_native(INTERP, retval, 0);
-
+        const INTVAL b = (PMC_type(SELF) == PMC_type(value)
+                          && u_val(SELF) == u_val(value)
+                          && u_env(SELF) == u_env(value))
+                         ? 1 : 0;
+        PMC * const retval = pmc_new(INTERP, dynpmc_LuaBoolean);
+        VTABLE_set_integer_native(INTERP, retval, b);
         RETURN(PMC *retval);
     }
 

Deleted: branches/vtable_morph_change/languages/perl6/Configure.pl
==============================================================================
--- branches/vtable_morph_change/languages/perl6/Configure.pl	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,9 +0,0 @@
-#! perl
-# $Id$
-# Copyright (C) 2008 The Perl Foundation
-
-use strict;
-use warnings;
-
-chdir '../..';
-`$^X -Ilib tools/dev/reconfigure.pl --step=gen::languages --languages=perl6`;

Deleted: branches/vtable_morph_change/languages/perl6/MAINTAINER
==============================================================================
--- branches/vtable_morph_change/languages/perl6/MAINTAINER	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,9 +0,0 @@
-# $Id$
-
-N: Patrick Michaud
-E: pmichaud at pobox.com
-
-Discussion generally takes place on irc.perl.org/#parrot and the
-perl6-compiler at perl.org mailing list.  Patches and bug reports
-can be sent to perl6-bug at perl.org .
-

Modified: branches/vtable_morph_change/languages/perl6/README
==============================================================================
--- branches/vtable_morph_change/languages/perl6/README	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/perl6/README	Tue Feb 10 02:09:33 2009	(r36517)
@@ -3,130 +3,12 @@
 =head1 Rakudo Perl 6
 
 This is the Perl 6 compiler for Parrot, called "Rakudo Perl 6",
-or "Rakudo" for short.  It's still fairly primitive, but it is rapidly expanding.
-See L<docs/STATUS> for a list of what has been implemented thus far.
+or "Rakudo" for short.
 
-=head2 Building and invoking Rakudo
+It has moved out of the parrot svn repository, and lives at
+L<http://github.com/rakudo/rakudo/>.
 
-To build the compiler, start by building Parrot, then change
-to the languages/perl6/ subdirectory and type "make".  This
-will create the compiler as a file called "perl6.pbc".  The ".pbc"
-stands for "Parrot bytecode", and represents an executable Parrot
-module.
-
-To run a Perl 6 program with Rakudo, issue a command like
-
-    $ parrot perl6.pbc hello.pl
-
-If you want to create a binary executable of the compiler
-that can be invoked as "perl6" from the command line, then
-try "make perl6".  This will create a "perl6" (or "perl6.exe")
-binary that can be directly used from the command line:
-
-    $ ./perl6 hello.pl
-
-This binary executable feature is still somewhat experimental,
-and may not work on all platforms.  Also, the binary has hardcoded
-paths to the Parrot build tree (especially the dynamic libraries
-and modules), so removing the build tree will cause the binary
-to stop working.
-
-If the Rakudo compiler is invoked without an explicit script to
-run -- i.e., as "parrot perl6.pbc" or just "perl6" -- it enters a
-small interactive mode that allows Perl 6 statements to be
-executed from the command line.  Each line entered is treated
-as a separate compilation unit, however (which means that subroutines
-are preserved after they are defined, but variables are not).
-
-=head2 Running the test suite
-
-Entering "make test" will run the test suite that comes bundled
-with Rakudo on Parrot.  This is a simple suite of tests, designed
-to make sure that the Rakudo compiler is basically working and that
-it's capable of running a simple test harness.
-
-Running "make spectest" will import relevant portions
-of the "official Perl 6 test suite" from the Pugs repository
-(http://svn.pugscode.org/pugs/t/spec/) and run all of these tests that
-are currently known to pass.
-
-At present we do not have any plans to directly store the
-official test suite as part of the Rakudo/Parrot repository,
-but will continue to fetch it from the Pugs repository.
-
-While in the C<languages/perl6> directory, you can an individual test from the
-command line with:
-
-    $ make t/spec/S29-str/ucfirst.t
-    t/spec/S29-str/ucfirst.rakudo .. 
-    1..4
-    ok 1 - simple
-    ok 2 - empty string
-    ok 3 - # SKIP unicode
-    ok 4 - # SKIP unicode
-    # FUDGED!
-    ok
-    All tests successful.
-    Files=1, Tests=4,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.57 cusr  0.06 csys =  0.65 CPU)
-    Result: PASS
-
-=head2 Where to get help or answers to questions
-
-There are several mailing lists, IRC channels, and wikis available
-with help for Perl 6 and Rakudo on Parrot.  Figuring out the right
-one to use is often the biggest battle.  Here are some rough
-guidelines:
-
-If you have a question about Perl 6 syntax or the right way to
-approach a problem using Perl 6, you probably want the
-C<perl6-users at perl.org> mailing list.  This list is primarily
-for the people who want to I<use> Perl 6 to write programs, as
-opposed to those who are implementing or developing the Perl 6
-language itself.
-
-Questions about the Rakudo compiler for Parrot and the Parrot
-compiler tools can go to C<perl6-compiler at perl.org>.  Discussion
-about Parrot itself generally takes place on C<parrot-porters at perl.org>.
-
-The Parrot and Rakudo development team tend to hang out on IRC a fair
-bit, either on C<irc.perl.org/#parrot> or C<irc.freenode.net/#perl6>.
-
-There are also Perl 6 and Parrot wikis, found at
-    L<http://www.perlfoundation.org/perl6/index.cgi>
-    L<http://www.perlfoundation.org/parrot/index.cgi>
-
-There is also a Rakudo related blog at L<http://rakudo.org/>, and
-a Parrot blog at L<http://parrotblog.org/>.
-
-=head2 Reporting bugs
-
-Bug reports should be sent to C<rakudobug at perl.org> with the moniker
-[BUG] (including the brackets) at the start of the subject so that
-it gets appropriately tagged in the RT system (https://rt.perl.org/rt3/).
-Please include or attach any sample source code that exhibits the
-bug, and if appropriate identify the svn revision number of the code
-that you're working from.  There's no need to cc: the perl6-compiler
-mailing list, as the RT system will handle this on its own.
-
-=head2 Submitting patches
-
-If you have a patch that fixes a bug or adds a new feature, please
-submit it to C<rakudobug at perl.org> with the moniker [PATCH]
-(including the brackets) at the start of the subject line.  We'll
-generally accept patches in any form if we can get them to work,
-but unified diff from the svn command is greatly preferred.  In
-general this means you can execute "svn diff >foo.patch" from
-the languages/perl6/ directory and just attach the foo.patch file.
-
-=head2 How the compiler works
-
-See F<docs/compiler_overview.pod>.
-
-=head1 AUTHOR
-
-Patrick Michaud (pmichaud at pobox.com) is the primary author and
-maintainer for Rakudo Perl 6 on Parrot.
+For more information on how to obtain and build it, please look at 
+L<http://perlgeek.de/blog-en/perl-6/where-rakudo-lives.writeback>
 
 =cut
-
-## vim: expandtab sw=4

Deleted: branches/vtable_morph_change/languages/perl6/ROADMAP
==============================================================================
--- branches/vtable_morph_change/languages/perl6/ROADMAP	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,170 +0,0 @@
-Updated: 2008-08-16
-
-Milestones
-----------
-
-This is a rough list of some of the major components to be added to Rakudo.
-This list also gives a sense of the rough prioritization
-of things -- i.e., getting return and control exceptions to work
-is a higher priority than heredocs or macros.  But it's also
-not intended to be rigid nor strictly sequential -- it's okay
-for people to work on some of the later milestones even if the
-earlier ones aren't complete.
-
-ON ESTIMATES: All hourly estimates in milestones B-W are rough 
-first-cut estimates IDEAL PROGRAMMER HOURS. Nobody should 
-depend on them for anything other than relative estimates of 
-difficulty.
-
-Where there's a time given and a percentage of task completion,
-the hours represent the estimate to completion.  For example,
-if a task says "3h" and "50% done", we still have 3 hours of
-idealized effort to go, not 1.5.
-
-
-A PGE needs to be refactored and updated to handle protoregexes and
-  longest token matching so we can use the STD grammar
-  Sub-milestones - each is 1 calendar month:
-  Not expected to fully block other milestones, except as indicated below
-
-    M1. PGE internal refactors and initial protoregex implementation (D1),
-        selected protoregex constructs added to Rakudo's grammar (D2),
-        interface design for pre-compilation and external libraries (D3, D4).
-
-    M2. Completed protoregex implementation (D1),
-        initial implementation of longest token matching in PGE (D1),
-        completed Rakudo grammar migration to protoregexes (D2),
-        beginning of P6-based "Prelude" implementation for Rakudo (D3),
-        initial implementations of external HLL library support (D4).
-	
-    M3. Substantially complete longest token matching in PGE (D1),
-        Rakudo using protoregexes and longest token matching in grammar (D2),
-        full protoregex and LTM support in Rakudo (D3),
-        integrate P6-based Prelude into Rakudo implementation (D3),
-        continued improvement of HLL library support (D4).
-	
-    M4. Completed PGE protoregex and longest token matching implementation (D1),
-        update Rakudo bottom-up parser to align with STD.pm (D2),
-        Rakudo and/or compiler tools able to parse STD.pm directly (D2),
-        substantial implementation of a P6-based Prelude for Rakudo (D3),
-        substantially complete external HLL libraries support (D4).
-        updated documentation and tests for all work performed, final report.
-
-B signature handling
-    pm estimate: 6h
-    (jonathan implementing, 40% done)
-
-C list assignment [depends on A, B]
-    waiting on some spec changes/updates
-    pm Estimate: 2h  
-
-D control exceptions (50% done)
-    Requires adding exception types to PCT
-        pm estimate: 3h     (25% done)
-    Requires adding exception closures (INIT, BEGIN, LAST, NEXT, etc.)
-        pm estimate: 2h
-    Writing exception throwers in Rakudo
-        pm estimate: 0.5h   (80% done)
-
-E regex, token, rule, grammar (60% done)
-    We have an initial implementation
-    Implementaiton needs tweaking
-    Depends on grammar improvements
-    Some advanced bits depend on PGE improvements
-
-    grammar improvements
-        2h
-    advanced bits [depends on pge improvements in A]
-        2h
-
-F Allow Perl 6 precompiled sources - write libraries in Perl 6 (85% done)
-    Depends on 'is export' (80% done)
-    Depends on 'is also'   (100% done for what we need here)
-    Depends on inline PIR  (30% done)
-    Depends on build system refactor
-    pm estimate 3h
-    
-G modules (overall 70% done)
-    subtask: better handling of namespaces  (60% done)
-    depends on a refactoring of namespaces in p6object (done)
-    pm estimate: 4h
-
-H lazy lists
-    we've decided to wait on this because lazy list specs are in flux
-    jw estimate: 8h
-
-I gather and take (done in Rakudo)
-    depends on resumable exceptions from pir 
-      (mostly done -- some improvements needed)
-
-J I/O
-    * Depends on an IO spec
-    * Depends on lazy lists 
-    * Depends on IO updates in Parrot
-    Small matter of writing wrapper methods to implement spec.
-
-K junction auto-threading (10% complete)
-    writing dispatch operators  
-        jw estimate: 8h
-    auto-threading
-        jw estimate: 24h
-    a simple version of autothreading junction operators exists
-    the remainder will hopefully be a grant for jw
-
-L hyper, reduction and cross meta-operators
-    depends on parser improvements in A
-    pm estimate: 6h for hyper
-                 1h for reduction
-                 4h for cross
-
-M slices 
-    * tests need writing
-    pm estimate: 
-                    5h study S09
-                    12h implement  (VERY rough)
-
-N slice context
-    pm estimate: 
-                    32h implement  (VERY rough)
-    
-O captures
-    Pm needs to send mail to p6l. - current tests don't seem to match 
-       Pm's understanding of the spec
-    pm estimate:
-                3h study spec
-                3h implement            
-
-P multi-argument return - return into named arguments [depends on captures]
-    Waiting for updates to Parrot calling conventions
-    PCT side
-       pm estimate: 8h     
-    Rakudo side
-        pm estimate: 4h
-
-Q multi sub & multi-method dispatch (50% done)
-    JW implementing
-    Depends on parrot implementation of MMD (implemented)
-    Depends on P6 Object update [Depends on G]
-    JW estimate: 16h
-
-R currying
-    PM estimate: 8h
-
-S operator overloading
-    Depends on the parser [Depends on A]
-    will likely implement a stub version in meantime
-    PM Estimate: (2h stub, 4h for complete version when A complete)
-
-T heredocs including pod heredocs
-    Depends on the parser [Depends on A]
-    PM Estimate: 2h
-
-U macros
-    Depends on the parser [Depends on A]
-    PM Estimate: 6h
-
-V module versioning
-    (estimate for start: christmas)
-     
-W other S09 features (typed arrays, sized types)
-    (estimate for start: christmas)

Deleted: branches/vtable_morph_change/languages/perl6/Test.pm
==============================================================================
--- branches/vtable_morph_change/languages/perl6/Test.pm	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,232 +0,0 @@
-# Copyright (C) 2007, The Perl Foundation.
-# $Id$
-
-## This is a temporary Test.pm to get us started until we get pugs's Test.pm
-## working. It's shamelessly stolen & adapted from MiniPerl6 in the pugs repo.
-
-# globals to keep track of our tests
-our $num_of_tests_run = 0;
-our $num_of_tests_failed = 0;
-our $num_of_tests_planned;
-our $todo_upto_test_num = 0;
-our $todo_reason = '';
-
-our $*WARNINGS = 0;
-
-# for running the test suite multiple times in the same process
-our $testing_started;
-
-
-## test functions
-
-# Compare numeric values with approximation
-sub approx ($x, $y) {
-    my $epsilon = 0.00001;
-    my $diff = abs($x - $y);
-    ($diff < $epsilon);
-}
-
-sub plan($number_of_tests) is export() {
-    $testing_started      = 1;
-    $num_of_tests_planned = $number_of_tests;
-
-    say '1..' ~ $number_of_tests;
-}
-
-multi sub pass($desc) is export() {
-    proclaim(1, $desc);
-}
-
-multi sub ok(Object $cond, $desc) is export() {
-    proclaim($cond, $desc);
-}
-
-multi sub ok(Object $cond) is export() { ok($cond, ''); }
-
-
-multi sub nok(Object $cond, $desc) is export() {
-    proclaim(!$cond, $desc);
-}
-
-multi sub nok(Object $cond) is export() { nok(!$cond, ''); }
-
-
-multi sub is(Object $got, Object $expected, $desc) is export() {
-    my $test = $got eq $expected;
-    proclaim($test, $desc);
-}
-
-multi sub is(Object $got, Object $expected) is export() { is($got, $expected, ''); }
-
-
-multi sub isnt(Object $got, Object $expected, $desc) is export() {
-    my $test = !($got eq $expected);
-    proclaim($test, $desc);
-}
-
-multi sub isnt(Object $got, Object $expected) is export() { isnt($got, $expected, ''); }
-
-multi sub is_approx(Object $got, Object $expected, $desc) is export() {
-    my $test = abs($got - $expected) <= 0.00001;
-    proclaim($test, $desc);
-}
-
-multi sub is_approx($got, $expected) is export() { is_approx($got, $expected, ''); }
-
-multi sub todo($reason, $count) is export() {
-    $todo_upto_test_num = $num_of_tests_run + $count;
-    $todo_reason = '# TODO ' ~ $reason;
-}
-
-multi sub todo($reason) is export() {
-    $todo_upto_test_num = $num_of_tests_run + 1;
-    $todo_reason = '# TODO ' ~ $reason;
-}
-
-multi sub skip()                is export() { proclaim(1, "# SKIP"); }
-multi sub skip($reason)         is export() { proclaim(1, "# SKIP " ~ $reason); }
-multi sub skip($count, $reason) is export() {
-    for 1..$count {
-        proclaim(1, "# SKIP " ~ $reason);
-    }
-}
-
-multi sub skip_rest() is export() {
-    skip($num_of_tests_planned - $num_of_tests_run, "");
-}
-
-multi sub skip_rest($reason) is export() {
-    skip($num_of_tests_planned - $num_of_tests_run, $reason);
-}
-
-sub diag($message) is export() { say '# '~$message; }
-
-
-multi sub flunk($reason) is export() { proclaim(0, "flunk $reason")}
-
-
-multi sub isa_ok($var,$type) is export() {
-    ok($var.isa($type), "The object is-a '$type'");
-}
-multi sub isa_ok($var,$type, $msg) is export() { ok($var.isa($type), $msg); }
-
-multi sub dies_ok($closure, $reason) is export() {
-    try {
-        $closure();
-    }
-    proclaim((defined $!), $reason);
-}
-multi sub dies_ok($closure) is export() {
-    dies_ok($closure, '');
-}
-
-multi sub lives_ok($closure, $reason) is export() {
-    try {
-        $closure();
-    }
-    proclaim((not defined $!), $reason);
-}
-multi sub lives_ok($closure) is export() {
-    lives_ok($closure, '');
-}
-
-multi sub eval_dies_ok($code, $reason) is export() {
-    proclaim((defined eval_exception($code)), $reason);
-}
-multi sub eval_dies_ok($code) is export() {
-    eval_dies_ok($code, '');
-}
-
-multi sub eval_lives_ok($code, $reason) is export() {
-    proclaim((not defined eval_exception($code)), $reason);
-}
-multi sub eval_lives_ok($code) is export() {
-    eval_lives_ok($code, '');
-}
-
-
-multi sub is_deeply($this, $that, $reason) {
-    my $val = _is_deeply( $this, $that );
-    proclaim($val, $reason);
-}
-
-multi sub is_deeply($this, $that) {
-    my $val = _is_deeply( $this, $that );
-    proclaim($val, '');
-}
-
-sub _is_deeply( $this, $that) {
-
-    if $this ~~ List && $that ~~ List {
-        return if +$this.values != +$that.values;
-        for $this Z $that -> $a, $b {
-            return if ! _is_deeply( $a, $b );
-        }
-        return True;
-    }
-    elsif $this ~~ Hash && $that ~~ Hash {
-        return if +$this.keys != +$that.keys;
-        for $this.keys.sort Z $that.keys.sort -> $a, $b {
-            return if $a ne $b;
-            return if ! _is_deeply( $this{$a}, $that{$b} );
-        }
-        return True;
-    }
-    elsif $this ~~ Str | Num | Int && $that ~~ Str | Num | Int {
-        return $this eq $that;
-    }
-    elsif $this ~~ Pair && $that ~~ Pair {
-        return $this.key eq $that.key
-               && _is_deeply( $this.value, $this.value );
-    }
-    elsif $this ~~ undef && $that ~~ undef && $this.WHAT eq $that.WHAT {
-        return True;
-    }
-
-    return;
-}
-
-
-## 'private' subs
-
-sub eval_exception($code) {
-    my $eval_exception;
-    try { eval ($code); $eval_exception = $! }
-    $eval_exception // $!;
-}
-
-sub proclaim(Object $cond, $desc) {
-    $testing_started  = 1;
-    $num_of_tests_run = $num_of_tests_run + 1;
-
-    if $cond.HOW().isa($cond, Junction) {
-        warn("Junction passed to proclaim");
-    }
-
-    unless $cond {
-        print "not ";
-        $num_of_tests_failed = $num_of_tests_failed + 1
-            unless  $num_of_tests_run <= $todo_upto_test_num;
-    }
-    print "ok ", $num_of_tests_run, " - ", $desc;
-    if $todo_reason and $num_of_tests_run <= $todo_upto_test_num {
-        print $todo_reason;
-    }
-    print "\n";
-}
-
-END {
-    # until END blocks can access compile-time symbol tables of outer scopes,
-    #  we need these declarations
-    our $testing_started;
-    our $num_of_tests_planned;
-    our $num_of_tests_run;
-    our $num_of_tests_failed;
-
-    if ($testing_started and $num_of_tests_planned != $num_of_tests_run) {  ##Wrong quantity of tests
-        diag("Looks like you planned $num_of_tests_planned tests, but ran $num_of_tests_run");
-    }
-    if ($testing_started and $num_of_tests_failed) {
-        diag("Looks like you failed $num_of_tests_failed tests of $num_of_tests_run");
-    }
-}

Deleted: branches/vtable_morph_change/languages/perl6/perl6.pir
==============================================================================
--- branches/vtable_morph_change/languages/perl6/perl6.pir	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,236 +0,0 @@
-=head1 TITLE
-
-perl6.pir - The Rakudo Perl 6 compiler.
-
-=head2 Description
-
-This is the base file for the Rakudo Perl 6 compiler.
-
-This file includes the parsing and grammar rules from
-the src/ directory, loads the relevant PGE libraries,
-and registers the compiler under the name 'Perl6'.
-
-=head2 Functions
-
-=over 4
-
-=item onload()
-
-Creates the Perl 6 compiler by subclassing a C<PCT::HLLCompiler> object.
-
-=cut
-
-.loadlib 'perl6_group'
-.loadlib 'perl6_ops'
-.include 'src/gen_builtins.pir'
-
-.namespace [ 'Perl6';'Compiler' ]
-
-.sub 'onload' :load :init :anon
-    load_bytecode 'PCT.pbc'
-
-    .local pmc p6meta, perl6
-    p6meta = get_hll_global ['Perl6Object'], '$!P6META'
-    perl6 = p6meta.'new_class'('Perl6::Compiler', 'parent'=>'PCT::HLLCompiler')
-
-    load_bytecode 'config.pbc'
-
-    perl6.'language'('Perl6')
-    perl6.'parsegrammar'('Perl6::Grammar')
-    perl6.'parseactions'('Perl6::Grammar::Actions')
-
-    ##  set the compilation stages in the @stages attribute
-    $P0 = split ' ', 'parse past check_syntax post pir evalpmc'
-    setattribute perl6, '@stages', $P0
-
-    ##  set the command line options
-    $P0 = split ' ', 'c e=s help|h target=s trace|t=s encoding=s output|o=s version|v'
-    setattribute perl6, '@cmdoptions', $P0
-
-    ##  set the $usage attribute
-    $P0 = new 'String'
-    $P0 = <<'USAGE'
-Usage: perl6 [switches] [--] [programfile] [arguments]
-  -c                   check syntax only (runs BEGIN and CHECK blocks)
-  -e program           one line of program
-  -h, --help           display this help text
-  --target=[stage]     specify compilation stage to emit
-  -t, --trace=[flags]  enable trace flags
-  --encoding=[mode]    specify string encoding mode
-  -o, --output=[name]  specify name of output file
-  -v, --version        display version information
-USAGE
-    setattribute perl6, '$usage', $P0
-
-    ##  set the $version attribute
-    .local pmc cfg
-    $P0  = new 'String'
-    $P0  = 'This is Rakudo Perl 6'
-    push_eh _handler
-
-    # currently works in the build tree, but not in the install tree
-    cfg  = _config()
-    $P0 .= ', revision '
-    $S0  = cfg['revision']
-    $P0 .= $S0
-    $P0 .= ' built on parrot '
-    $S0  = cfg['VERSION']
-    $P0 .= $S0
-    $S0  = cfg['DEVEL']
-    $P0 .= $S0
-    $P0 .= "\n"
-    $P0 .= 'for '
-    $S0  = cfg['archname']
-    $P0 .= $S0
-  _handler:
-    pop_eh
-    $P0 .= ".\n\nCopyright 2006-2008, The Perl Foundation.\n"
-    setattribute perl6, '$version', $P0
-
-    ##  create a list for holding the stack of nested blocks
-    $P0 = new ['List']
-    set_hll_global ['Perl6';'Grammar';'Actions'], '@?BLOCK', $P0
-
-    ## create a list for holding the stack of nested package
-    ## declarators
-    $P0 = new 'List'
-    set_hll_global ['Perl6';'Grammar';'Actions'], '@?PKGDECL', $P0
-
-    ## create a list for holding the stack of nested package
-    ## namespaces (we store the namespace as a flat, ::
-    ## separated string for now, for handing to .parse_name)
-    $P0 = new 'List'
-    set_hll_global ['Perl6';'Grammar';'Actions'], '@?NS', $P0
-
-    ## create a (shared) metaclass node
-    $P0 = get_hll_global ['PAST'], 'Var'
-    $P0 = $P0.'new'( 'name'=>'metaclass', 'scope'=>'register' )
-    set_hll_global ['Perl6';'Grammar';'Actions'], '$?METACLASS', $P0
-
-    ## create the $?CLASSMAP hash
-    $P0 = new ['Hash']
-    set_hll_global ['Perl6';'Grammar';'Actions'], '%?CLASSMAP', $P0
-
-    ##  create a list of END blocks to be run
-    $P0 = new 'List'
-    set_hll_global ['Perl6'], '@?END_BLOCKS', $P0
-
-    ##  tell PAST::Var how to encode Perl6Str and Str values
-    $P0 = get_hll_global ['PAST';'Compiler'], '%valflags'
-    $P0['Perl6Str'] = 'e'
-    $P0['Str'] = 'e'
-.end
-
-
-.namespace ['Perl6';'Compiler']
-
-=item check_syntax(source [, "option" => value, ...])
-
-Check the syntax of C<source> after PAST tree has been built,
-to ensure C<BEGIN> and C<CHECK> blocks have been executed.
-
-=cut
-
-.sub 'check_syntax' :method
-    .param pmc source
-    .param pmc adverbs      :slurpy :named
-
-    $I0 = adverbs['c']
-    if $I0 goto check_syntax
-    .return ()
-  check_syntax:
-    ## if we're here, then syntax is OK
-    say 'syntax OK'
-    exit 0
-.end
-
-
-=item main(args :slurpy)  :main
-
-Start compilation by passing any command line C<args>
-to the Perl 6 compiler.
-
-=cut
-
-.sub 'main' :main
-    .param pmc args_str
-
-    $P0 = compreg 'Perl6'
-    $P1 = $P0.'command_line'(args_str, 'encoding'=>'utf8', 'transcode'=>'ascii')
-
-    .include 'iterator.pasm'
-    .local pmc iter
-    $P0 = get_hll_global ['Perl6'], '@?END_BLOCKS'
-    iter = new 'Iterator', $P0
-    iter = .ITERATE_FROM_END
-  iter_loop:
-    unless iter goto iter_end
-    $P0 = pop iter
-    $P0()
-    goto iter_loop
-  iter_end:
-.end
-
-
-.sub 'parse_name' :method
-    .param string name
-    ##  remove any type parameterization for now
-    .local string type_param
-    type_param = ''
-    $I0 = index name, '['
-    if $I0 == -1 goto type_param_done
-    type_param = substr name, $I0
-    name = substr name, 0, $I0
-  type_param_done:
-    ##  divide name based on ::
-    .local pmc list
-    list = split '::', name
-    ##  move any leading sigil to the last item
-    .local string sigil
-    $S0 = list[0]
-    sigil = substr $S0, 0, 1
-    $I0 = index '$@%&', $S1
-    if $I0 < 0 goto sigil_done
-    substr $S0, 0, 1, ''
-    list[0] = $S0
-    $S0 = list[-1]
-    $S0 = concat sigil, $S0
-    list[-1] = $S0
-  sigil_done:
-    ##  remove any empty items from the list
-    $P0 = iter list
-    list = new 'ResizablePMCArray'
-  iter_loop:
-    unless $P0 goto iter_done
-    $S0 = shift $P0
-    unless $S0 goto iter_loop
-    push list, $S0
-    goto iter_loop
-  iter_done:
-    if type_param == '' goto no_add_type_param
-    $S0 = pop list
-    concat $S0, type_param
-    push list, $S0
-  no_add_type_param:
-    .return (list)
-.end
-
-
-.include 'src/gen_grammar.pir'
-.include 'src/parser/expression.pir'
-.include 'src/parser/methods.pir'
-.include 'src/parser/quote_expression.pir'
-.include 'src/gen_actions.pir'
-.include 'src/gen_metaop.pir'
-.include 'src/gen_junction.pir'
-
-
-=back
-
-=cut
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/vtable_morph_change/languages/pipp/src/pct/actions.pm
==============================================================================
--- branches/vtable_morph_change/languages/pipp/src/pct/actions.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/pipp/src/pct/actions.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -425,6 +425,12 @@
     make $past;
 }
 
+method switch_statement($/) {
+    my $past := PAST::Stmts.new( :name('switch') );
+
+    make $past;
+}
+
 method var_assign($/) {
     make PAST::Op.new(
         :pasttype('bind'),

Modified: branches/vtable_morph_change/languages/pipp/src/pct/grammar.pg
==============================================================================
--- branches/vtable_morph_change/languages/pipp/src/pct/grammar.pg	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/pipp/src/pct/grammar.pg	Tue Feb 10 02:09:33 2009	(r36517)
@@ -134,6 +134,7 @@
     | <constant_definition>            {*}  #= constant_definition
     | <global_declaration>             {*}  #= global_declaration
     | <if_statement>                   {*}  #= if_statement
+    | <switch_statement>               {*}  #= switch_statement
     | <while_statement>                {*}  #= while_statement
     | <do_while_statement>             {*}  #= do_while_statement
     | <for_statement>                  {*}  #= for_statement
@@ -211,6 +212,11 @@
     'else' '{' <statement_list> '}'
 }
 
+rule switch_statement {
+    'switch' '(' <expression> ')'
+    '{' '}' {*}
+}
+
 rule elseif_clause {
     'elseif' <conditional_expression>
     {*}

Modified: branches/vtable_morph_change/languages/pipp/t/php/control_flow.t
==============================================================================
--- branches/vtable_morph_change/languages/pipp/t/php/control_flow.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/pipp/t/php/control_flow.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, The Perl Foundation.
+# Copyright (C) 2008-2009, The Perl Foundation.
 # $Id$
 
 =head1 NAME
@@ -11,20 +11,17 @@
 
 =head1 DESCRIPTION
 
-Test control flow.
+Test control flow, that is C<if>, C<while>, C<for> and C<switch>.
 
 =cut
 
 # pragmata
 use strict;
 use warnings;
-
 use FindBin;
 use lib "$FindBin::Bin/../../../../lib", "$FindBin::Bin/../../lib";
 
-use Parrot::Config ();
-use Parrot::Test;
-use Test::More     tests => 18;
+use Parrot::Test  tests => 19;
 
 language_output_is( 'Pipp', <<'CODE', <<'OUT', 'if, one statement in block' );
 <?php
@@ -311,3 +308,12 @@
 round 8
 round 9
 OUT
+
+language_output_is( 'Pipp', <<'CODE', '', 'switch without a case' );
+<?php
+
+switch (22) {
+}
+
+?>
+CODE

Modified: branches/vtable_morph_change/languages/pynie/src/builtins/io.pir
==============================================================================
--- branches/vtable_morph_change/languages/pynie/src/builtins/io.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/pynie/src/builtins/io.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -58,7 +58,7 @@
 
 Patrick Michaud <pmichaud at pobox.com> is the current author and
 maintainer.  Patches and suggestions can be sent to
-<parrot-porters at perl.org> or <perl-compiler at perl.org> .
+<parrot-dev at lists.parrot.org> or <perl-compiler at perl.org> .
 
 =cut
 

Modified: branches/vtable_morph_change/languages/pynie/src/builtins/lists.pir
==============================================================================
--- branches/vtable_morph_change/languages/pynie/src/builtins/lists.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/pynie/src/builtins/lists.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -41,7 +41,7 @@
 
 Patrick Michaud <pmichaud at pobox.com> is the current author and
 maintainer.  Patches and suggestions can be sent to
-<parrot-porters at perl.org> or <perl-compiler at perl.org> .
+<parrot-dev at lists.parrot.org> or <perl-compiler at perl.org> .
 
 =cut
 

Modified: branches/vtable_morph_change/languages/pynie/src/builtins/oper.pir
==============================================================================
--- branches/vtable_morph_change/languages/pynie/src/builtins/oper.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/pynie/src/builtins/oper.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -164,7 +164,7 @@
 
 Patrick Michaud <pmichaud at pobox.com> is the current author and
 maintainer.  Patches and suggestions can be sent to
-<parrot-porters at perl.org> or <perl-compiler at perl.org> .
+<parrot-dev at lists.parrot.org> or <perl-compiler at perl.org> .
 
 =cut
 

Modified: branches/vtable_morph_change/languages/pynie/src/parser/indent.pir
==============================================================================
--- branches/vtable_morph_change/languages/pynie/src/parser/indent.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/pynie/src/parser/indent.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -120,7 +120,7 @@
 
 Patrick Michaud <pmichaud at pobox.com> is the current author and
 maintainer.  Patches and suggestions can be sent to
-<parrot-porters at perl.org> or <perl-compiler at perl.org> .
+<parrot-dev at lists.parrot.org> or <perl-compiler at perl.org> .
 
 =cut
 

Modified: branches/vtable_morph_change/languages/squaak/doc/tutorial_episode_1.pod
==============================================================================
--- branches/vtable_morph_change/languages/squaak/doc/tutorial_episode_1.pod	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/languages/squaak/doc/tutorial_episode_1.pod	Tue Feb 10 02:09:33 2009	(r36517)
@@ -260,7 +260,7 @@
 
 =over 4
 
-=item * Parrot mailing list: parrot-porters at perl.org
+=item * Parrot mailing list: parrot-dev at lists.parrot.org
 
 =item * IRC: join #parrot on irc.perl.org
 

Modified: branches/vtable_morph_change/lib/Parrot/Configure/Compiler.pm
==============================================================================
--- branches/vtable_morph_change/lib/Parrot/Configure/Compiler.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/lib/Parrot/Configure/Compiler.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -34,6 +34,13 @@
     move_if_diff
 );
 
+# report the makefile and lineno
+sub makecroak {
+    my ($conf, $error) = @_;
+    my ($file, $line) = ($conf->{_compiler_file}, $conf->{_compiler_line});
+    die "$error at $file line $line\n";
+}
+
 our %file_types_info = (
     makefile => {
         comment_type    => '#',
@@ -396,9 +403,11 @@
     # this loop can not be implemented as a foreach loop as the body
     # is dependent on <IN> being evaluated lazily
 
+    $conf->{_compiler_file} = $source;
     my $former_truth = -1;
   LINE:
     while ( my $line = <$in> ) {
+        $conf->{_compiler_line} = $.;
 
         # everything after the line starting with #perl is eval'ed
         if ( $line =~ /^#perl/ && $options{feature_file} ) {
@@ -413,7 +422,7 @@
             # interpolate @foo@ values
             $text =~ s{ \@ (\w+) \@ }{\$conf->data->get("$1")}gx;
             eval $text;
-            die $@ if $@;
+            croak $@ if $@;
             last LINE;
         }
         if ( $options{conditioned_lines} ) {
@@ -531,7 +540,7 @@
 
         if ( $options{replace_slashes} ) {
             if ( $line =~ m{/$} ) {
-                die "$source:$.: line ends in a slash\n";
+                croak "$source:$.: line ends in a slash\n";
             }
 
             $line =~ s{(/+)}{
@@ -651,18 +660,18 @@
                     $op = 'NOT';
                 }
                 else {
-                    die "invalid op \"$op\" in \"$_[1]\" at \"$prevexpr\".\n";
+                    makecroak($conf, "invalid op \"$op\" in \"$_[1]\" at \"$prevexpr\"");
                 }
                 $key = next_expr($expr);
             }
             elsif ($prevexpr) {
-                die "Makefile conditional syntax error: missing op in \"$_[1]\" at \"$prevexpr\".\n";
+                makecroak($conf, "Makefile conditional syntax error: missing op in \"$_[1]\" at \"$prevexpr\"");
             }
             else {
                 last LOOP; # end of expr, nothing left
             }
             if ($prevexpr eq $expr) {
-                die "Makefile conditional parser error in \"$_[1]\" at \"$prevexpr\".\n";
+                makecroak($conf, "Makefile conditional parser error in \"$_[1]\" at \"$prevexpr\"");
             }
         }
         return $truth;

Modified: branches/vtable_morph_change/lib/Parrot/Docs/Section/Languages.pm
==============================================================================
--- branches/vtable_morph_change/lib/Parrot/Docs/Section/Languages.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/lib/Parrot/Docs/Section/Languages.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -57,7 +57,6 @@
         $self->new_section( 'lolcode',     'lolcode.html',    '', 'languages/lolcode' ),
         $self->new_section( 'Lua',         'lua.html',        '', 'languages/lua' ),
         $self->new_section( 'Ook!',        'ook.html',        '', 'languages/ook' ),
-        $self->new_section( 'Perl6',       'perl6.html',      '', 'languages/perl6' ),
         $self->new_section( 'pheme',       'pheme.html',      '', 'languages/pheme' ),
         $self->new_section( 'Pipp',        'pipp.html',       '', 'languages/pipp' ),
         $self->new_section( 'PIR',         'pir.html',        '', 'languages/PIR' ),

Modified: branches/vtable_morph_change/lib/Parrot/Pmc2c/Attribute.pm
==============================================================================
--- branches/vtable_morph_change/lib/Parrot/Pmc2c/Attribute.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/lib/Parrot/Pmc2c/Attribute.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -99,6 +99,11 @@
     my $pmcname        = $pmc->{name};
     my $attrtype       = $self->{type};
     my $attrname       = $self->{name};
+
+    # Store regexes used to check some types to avoid repetitions
+    my $isptrtostring = qr/STRING\s*\*$/;
+    my $isptrtopmc    = qr/PMC\s*\*$/;
+
     my $decl           = <<"EOA";
 
 /* Generated macro accessors for '$attrname' attribute of $pmcname PMC. */
@@ -121,14 +126,14 @@
             (dest) = VTABLE_get_number(interp, attr_value); \\
 EOA
     }
-    elsif ($attrtype =~ /STRING\s*\*[^\*]/) {
+    elsif ($attrtype =~ $isptrtostring) {
         $decl .= <<"EOA";
             PMC *attr_value = VTABLE_get_attr_str(interp, \\
                               pmc, Parrot_str_new_constant(interp, "$attrname")); \\
             (dest) = VTABLE_get_string(interp, attr_value); \\
 EOA
     }
-    elsif ($attrtype =~ /PMC\s*\*[^\*]/) {
+    elsif ($attrtype =~ $isptrtopmc) {
         $decl .= <<"EOA";
             (dest) = VTABLE_get_attr_str(interp, \\
                               pmc, Parrot_str_new_constant(interp, "$attrname")); \\
@@ -170,7 +175,7 @@
                               Parrot_str_new_constant(interp, "$attrname"), attr_value); \\
 EOA
     }
-    elsif ($attrtype =~ /STRING\s*\*[^\*]/) {
+    elsif ($attrtype =~ $isptrtostring) {
         $decl .= <<"EOA";
             PMC *attr_value = pmc_new(interp, enum_class_String); \\
             VTABLE_set_string_native(interp, attr_value, value); \\
@@ -178,7 +183,7 @@
                               Parrot_str_new_constant(interp, "$attrname"), attr_value); \\
 EOA
     }
-    elsif ($attrtype =~ /PMC\s\*[^\*]/) {
+    elsif ($attrtype =~ $isptrtopmc) {
         $decl .= <<"EOA";
             VTABLE_set_attr_str(interp, pmc, \\
                               Parrot_str_new_constant(interp, "$attrname"), value); \\

Modified: branches/vtable_morph_change/lib/Parrot/Pmc2c/Pmc2cMain.pm
==============================================================================
--- branches/vtable_morph_change/lib/Parrot/Pmc2c/Pmc2cMain.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/lib/Parrot/Pmc2c/Pmc2cMain.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,10 +1,15 @@
 # Copyright (C) 2004-2009, The Perl Foundation.
 # $Id$
+
 package Parrot::Pmc2c::Pmc2cMain;
+
 use strict;
 use warnings;
 
+use File::Spec ();
+use Carp;
 use Storable;
+
 use Parrot::PMC ();
 use Parrot::Pmc2c::VTable ();
 use Parrot::Pmc2c::Dumper 'dump_pmc';
@@ -16,8 +21,6 @@
 use Parrot::Pmc2c::PMC::Ref ();
 use Parrot::Pmc2c::PMC::SharedRef ();
 use Parrot::Pmc2c::PMC::Object ();
-use File::Spec ();
-use Carp;
 
 $SIG{'__WARN__'} = sub { use Carp; warn $_[0]; Carp::confess; };
 
@@ -86,13 +89,14 @@
         unless ( defined $allargsref->{args} and ref( $allargsref->{args} ) eq q{ARRAY} );
 
     unshift @{ $allargsref->{include} },
-        ( ".", "$allargsref->{bin}/../..", "$allargsref->{bin}/../../src/pmc/" );
+        '.', "$allargsref->{bin}/../..", "$allargsref->{bin}/../../src/pmc", "$allargsref->{bin}/../../src/dynpmc";
 
     foreach my $opt qw(nolines) {
         if ( !defined $allargsref->{opt}{$opt} ) {
             $allargsref->{opt}{$opt} = 0;
         }
     }
+
     return bless( $allargsref, $class );
 }
 

Modified: branches/vtable_morph_change/lib/Parrot/Test.pm
==============================================================================
--- branches/vtable_morph_change/lib/Parrot/Test.pm	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/lib/Parrot/Test.pm	Tue Feb 10 02:09:33 2009	(r36517)
@@ -961,15 +961,18 @@
                 my $iculibs = $PConfig{has_icu} ? $PConfig{icu_shared} : q{};
                 my $libparrot =
                     $PConfig{parrot_is_shared}
-                    ? ("$PConfig{rpath_blib} " .
-                      (($^O =~ m/MSWin32/ and $PConfig{cc} eq 'cl')
-                         ? "" : "-L$PConfig{blib_dir} "))
-                    . (
-                      $^O =~ m/MSWin32/
-                    ? $PConfig{libparrot_ldflags}
-                    : "-lparrot"
-                    )
-                    : File::Spec->join( $PConfig{blib_dir}, $PConfig{libparrot_static} );
+                      ? ("$PConfig{rpath_blib} "
+                        . (($^O =~ m/MSWin32/ and $PConfig{cc} =~ /\bcl\b/)
+                          ? ""
+                          : "-L$PConfig{blib_dir} "))
+                        . ($^O =~ m/MSWin32/
+                          ? File::Spec->join(
+                              @PConfig{qw/build_dir libparrot_ldflags/},
+                          )
+                          : "-lparrot")
+                      : File::Spec->join(
+                          @PConfig{qw/build_dir blib_dir libparrot_static/},
+                      );
                 my $cmd =
                       "$PConfig{link} $PConfig{linkflags} $PConfig{ld_debug} "
                     . "$obj_f $cfg $PConfig{ld_out}$exe_f "

Modified: branches/vtable_morph_change/parrot.spec
==============================================================================
--- branches/vtable_morph_change/parrot.spec	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/parrot.spec	Tue Feb 10 02:09:33 2009	(r36517)
@@ -115,7 +115,6 @@
 %exclude %{_bindir}/perl6
 %exclude %{_bindir}/parrot_debugger
 %exclude %{_bindir}/pbc_*
-%exclude %{_bindir}/pdump
 %{_bindir}/*
 %{_libdir}/parrot
 %{_libdir}/libparrot.so.*
@@ -135,7 +134,7 @@
 %{_bindir}/pbc_info
 %{_bindir}/pbc_merge
 %{_bindir}/pbc_to_exe
-%{_bindir}/pdump
+%{_bindir}/pbc_dump
 %{_includedir}/parrot
 %{_libdir}/libparrot.so
 %{_libdir}/libparrot.a

Modified: branches/vtable_morph_change/parrotbug
==============================================================================
--- branches/vtable_morph_change/parrotbug	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/parrotbug	Tue Feb 10 02:09:33 2009	(r36517)
@@ -64,7 +64,7 @@
 developers.
 
 If you're just looking for help with parrot, subscribe to the parrot
-mailing list, parrot-porters<at>perl.org.
+mailing list, parrot-dev<at>lists.parrot.org.
 
 
 

Modified: branches/vtable_morph_change/ports/cygwin/README
==============================================================================
--- branches/vtable_morph_change/ports/cygwin/README	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/ports/cygwin/README	Tue Feb 10 02:09:33 2009	(r36517)
@@ -57,10 +57,10 @@
   /usr/bin/parrot.exe
   /usr/bin/parrot_config.exe
   /usr/bin/parrot_debugger.exe
+  /usr/bin/pbc_dump.exe
   /usr/bin/pbc_info.exe
   /usr/bin/pbc_merge.exe
   /usr/bin/pbc_to_exe.exe
-  /usr/bin/pdump.exe
   /usr/lib/parrot/config_lib.pasm
   /usr/lib/parrot/myconfig
   /usr/lib/parrot/parrotbug

Modified: branches/vtable_morph_change/ports/debian/changelog
==============================================================================
--- branches/vtable_morph_change/ports/debian/changelog	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/ports/debian/changelog	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,3 +1,9 @@
+parrot (0.9.0-2) unstable; urgency=low
+  * debian/control.in:
+    - Updated Description of all packages.
+
+ -- Allison Randal <allison at parrot.org>  Fri, 23 Jan 2009 15:16:25 -0800
+
 parrot (0.9.0-1) unstable; urgency=low
 
   * New upstream release (Closes: #444707).

Modified: branches/vtable_morph_change/ports/debian/control.in
==============================================================================
--- branches/vtable_morph_change/ports/debian/control.in	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/ports/debian/control.in	Tue Feb 10 02:09:33 2009	(r36517)
@@ -12,9 +12,8 @@
 Suggests: parrot-doc
 Recommends: perl
 Description: Virtual machine for dynamic languages
- Parrot is a virtual machine designed to efficiently compile and execute
- bytecode for dynamic languages. Parrot currently hosts a variety of language
- implementations in various stages of completion, including Tcl, Javascript,
+ Parrot is a bytecode-based virtual machine designed for dynamic languages.
+ Parrot hosts a variety of language implementations, including Tcl, Javascript,
  Ruby, Lua, Scheme, PHP, Python, Perl 6, and a .NET bytecode translator.
 
 Package: libparrot%SOVERSION%
@@ -23,34 +22,22 @@
 Depends: ${shlibs:Depends}
 Provides: libparrot
 Conflicts: libparrot
-Description: Virtual machine for dynamic languages
- Parrot is a virtual machine designed to efficiently compile and execute
- bytecode for dynamic languages. Parrot currently hosts a variety of language
- implementations in various stages of completion, including Tcl, Javascript,
- Ruby, Lua, Scheme, PHP, Python, Perl 6, and a .NET bytecode translator.
- .
- This package contains the Parrot shared library.
+Description: Parrot shared library
+ This package contains the Parrot shared library, used by the Parrot virtual
+ machine and by programs that embed Parrot.
  
 Package: libparrot-dev
 Architecture: any
 Section: libdevel
 Depends: libparrot%SOVERSION% (= ${binary:Version}), parrot
-Description: Virtual machine for dynamic languages
- Parrot is a virtual machine designed to efficiently compile and execute
- bytecode for dynamic languages. Parrot currently hosts a variety of language
- implementations in various stages of completion, including Tcl, Javascript,
- Ruby, Lua, Scheme, PHP, Python, Perl 6, and a .NET bytecode translator.
- .
+Description: Parrot shared library development files
  This package contains files needed to develop applications which embed Parrot.
 
 Package: parrot-doc
 Architecture: all
 Section: doc
 Suggests: perl-doc
-Description: Virtual machine for dynamic languages
- Parrot is a virtual machine designed to efficiently compile and execute
- bytecode for dynamic languages. Parrot currently hosts a variety of language
- implementations in various stages of completion, including Tcl, Javascript,
- Ruby, Lua, Scheme, PHP, Python, Perl 6, and a .NET bytecode translator.
- .
- This package contains various documentation for Parrot.
+Description: Parrot documentation
+ Parrot manual pages and raw Pod documentation. If you are developing a
+ compiler or extensions for Parrot, you will need this. If you're only using a
+ Parrot hosted language, the language-specific documentation is sufficient.

Modified: branches/vtable_morph_change/ports/debian/parrot.install
==============================================================================
--- branches/vtable_morph_change/ports/debian/parrot.install	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/ports/debian/parrot.install	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,6 +1,6 @@
 usr/bin/parrot
 usr/bin/pbc_disassemble
+usr/bin/pbc_dump
 usr/bin/pbc_info
 usr/bin/pbc_merge
-usr/bin/pdump
 usr/lib/parrot/*

Modified: branches/vtable_morph_change/ports/debian/rules
==============================================================================
--- branches/vtable_morph_change/ports/debian/rules	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/ports/debian/rules	Tue Feb 10 02:09:33 2009	(r36517)
@@ -26,7 +26,7 @@
 	$(MAKE) installable
 	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" docs/running.pod debian/parrot.1
 	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" parrot_config debian/parrot_config.1
-	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pdump.c debian/pdump.1
+	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_dump.c debian/pbc_dump.1
 	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_disassemble.c debian/pbc_disassemble.1
 	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/parrot_debugger.c debian/parrot-debugger.1
 	pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_info.c debian/pbc_info.1
@@ -36,7 +36,7 @@
 clean:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp configure-stamp debian/parrot.1 debian/parrot_config.1 debian/pdump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/nci_test.o src/main.o ext/Parrot-Embed/Makefile.PL languages/PIR/Makefile languages/perl5/Makefile languages/pynie/Makefile runtime/parrot/include/signal.pasm test.c test.ldo
+	rm -f build-stamp configure-stamp debian/parrot.1 debian/parrot_config.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/nci_test.o src/main.o ext/Parrot-Embed/Makefile.PL languages/PIR/Makefile languages/perl5/Makefile languages/pynie/Makefile runtime/parrot/include/signal.pasm test.c test.ldo
 	[ ! -f Makefile ] || $(MAKE) distclean
 	dh_clean 
 
@@ -77,7 +77,7 @@
 	dh_testdir -a
 	dh_testroot -a
 	dh_installchangelogs -a ChangeLog
-	dh_installman -pparrot debian/parrot.1 debian/pdump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1
+	dh_installman -pparrot debian/parrot.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1
 	dh_installdocs -a
 	dh_strip -a
 	dh_compress -a

Modified: branches/vtable_morph_change/ports/macports/Portfile
==============================================================================
--- branches/vtable_morph_change/ports/macports/Portfile	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/ports/macports/Portfile	Tue Feb 10 02:09:33 2009	(r36517)
@@ -3,7 +3,7 @@
 PortSystem              1.0
 
 name			parrot
-version			0.5.2
+version			0.9.0
 categories		lang devel
 maintainers             bfulgham coleda.com:will
 description		Open source virtual machine
@@ -15,12 +15,12 @@
         and a .NET bytecode translator.
 
 platforms		darwin
-homepage		http://www.parrotcode.org/
-master_sites		http://www.cpan.org/authors/id/R/RG/RGRJR/
+homepage		http://www.parrot.org/
+master_sites		ftp://ftp.parrot.org/pub/parrot/releases/devel/0.9.0
 
-checksums		md5 0a87f7e5437315f67c0848c5cb2b6d0b
+checksums		md5 7b70d9b8708e5ed01c210692a7afda0a
 
-depends_build		bin:perl:perl5.8
+depends_build		bin:perl:perl5
 depends_lib			port:gmp port:icu
 
 configure.cmd		perl Configure.pl
@@ -28,9 +28,7 @@
 # build static to avoid runtime lib issues for now
 configure.args		--optimize --parrot_is_shared=0
 
-# install target is temporarily disabled as it might conflict with development
-# users of a port should have no such trouble, however.
-destroot.target         reallyinstall
+destroot.target         install
 
 build.type		gnu
 build.target		

Modified: branches/vtable_morph_change/runtime/parrot/library/P6object.pir
==============================================================================
--- branches/vtable_morph_change/runtime/parrot/library/P6object.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/runtime/parrot/library/P6object.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -705,8 +705,8 @@
 =head1 AUTHOR
 
 Written and maintained by Patrick R. Michaud, C<< pmichaud at pobox.com >>.
-Please send patches, feedback, and suggestions to the parrot-porters
-mailing list or to C< parrotbug at parrotcode.org >.
+Please send patches, feedback, and suggestions to the parrot-dev mailing
+list or to C< parrotbug at parrotcode.org >.
 
 =head1 COPYRIGHT
 

Modified: branches/vtable_morph_change/runtime/parrot/library/Parrot/Coroutine.pir
==============================================================================
--- branches/vtable_morph_change/runtime/parrot/library/Parrot/Coroutine.pir	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/runtime/parrot/library/Parrot/Coroutine.pir	Tue Feb 10 02:09:33 2009	(r36517)
@@ -223,7 +223,7 @@
 
 =back
 
-Please report any others you find to C<E<lt>parrot-porters at perl.orgE<gt>>.
+Please report any others you find to C<E<lt>parrot-dev at lists.parrot.orgE<gt>>.
 
 =head1 SEE ALSO
 

Deleted: branches/vtable_morph_change/src/bignum.c
==============================================================================
--- branches/vtable_morph_change/src/bignum.c	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,3213 +0,0 @@
-/*
-Copyright (C) 2001-2006, The Perl Foundation.
-$Id$
-
-=head1 NAME
-
-src/bignum.c - A decimal arithmetic library Parrot
-
-=head1 DESCRIPTION
-
-This code is intended for inclusion in the parrot project, and also
-for backporting into Perl5 (as a CPAN module).  Any patches to this
-code will likely find their way back to the Mother Ship, as it were.
-
-There is a good deal of scope for improving the speed of this code,
-modifications are encouraged as long as the extended regression tests
-continue to pass.
-Alex Gough, 2002
-
-I<It was a very inconvenient habit of kittens (Alice had once made the
-remark) that, whatever you say to them, they always purr.  "If they
-would only purr for `yes', and mew for `no', or any rule of that sort",
-she had said, "so that one could keep up a conversation!  But how can
-you talk with a person if they always say the same thing?">
-
-I<On this occasion the kitten only purred: and it was impossible to
-guess whether it meant `yes' or `no'.>
-
-=head2 When in parrot
-
-When the library is used within parrot, all calls expect an additional
-first argument of an interpreter, for the purposes of memory allocation,
-some internal macros do not (getd/setd and CHECK(O|U)FLOW.
-
-If you're being useful and inserting proper rapid fillins, start
-with the C<BN_i*> methods, but make sure any errors can still be
-thrown.
-
-=head2 Macros
-
-Access digits, macros assume length given.
-
-=over 4
-
-=cut
-
-*/
-
-#include <stdio.h>
-#include "bignum.h"
-#include <string.h> /* XXX:ajg fixme later*/
-
-/* * This lot wants to go in a (bignum specific seperate header file * */
-
-/*
-
-=item C<BN_setd(BIGNUM*, pos, value)>
-
-Set digit at C<pos> (zero is lsd) to C<value>.
-
-=item C<int BN_getd(BIGNUM*, pos)>
-
-Get value of digit at C<pos>.
-
-=cut
-
-*/
-#define BN_setd(x, y, z) \
-    ((x)->buffer[(y) / BN_D_PER_NIB] = \
-     ((z) << ((y) % BN_D_PER_NIB)*4) | \
-     ((x)->buffer[(y) / BN_D_PER_NIB] & ~(15<< ((y) % BN_D_PER_NIB)*4)))
-#define BN_getd(x, y) \
-    (((x)->buffer[(y) / BN_D_PER_NIB] >> \
-     ((y) % BN_D_PER_NIB)*4) & 15)
-
-/*
-
-=item C<CHECK_OVERFLOW(bn, incr, context)>
-
-If increasing the exponent of C<bn> by C<incr> will cause overflow (as
-decided by C<elimit>), returns true.
-
-=cut
-
-*/
-
-#define CHECK_OVERFLOW(bn, incr, context) \
-    ((context)->elimit - ((bn)->expn + (bn)->digits -1) < (incr) ? 1 : 0)
-
-/*
-
-=item C<CHECK_UNDERFLOW(bn, decrement, context)>
-
-If subtracting C<decrement> (a positive number) from the exponent
-of C<bn> would cause underflow, returns true.
-
-=cut
-
-*/
-
-#define CHECK_UNDERFLOW(bn, decr, context) \
-    ((context)->elimit + ((bn)->expn + (bn)->digits -1) > (decr) ? 0 : 1)
-
-/*
-
-=back
-
-Special Values
-
-=over 4
-
-=item C<am_INF(bn)>
-
-True if C<bn> is +Infinity or -Infinity.
-
-=cut
-
-*/
-
-#define am_INF(bn)  ((bn)->flags & BN_INF_FLAG)
-
-/*
-
-=item C<am_NAN(bn)>
-
-True if C<bn> is either a quiet or signalling NaN.
-
-=cut
-
-*/
-
-#define am_NAN(bn)  ((bn)->flags & (BN_sNAN_FLAG | BN_qNAN_FLAG))
-
-/*
-
-=item C<am_sNAN(bn)>
-
-True if C<bn> is a signalling NaN.
-
-=cut
-
-*/
-
-#define am_sNAN(bn) ((bn)->flags & BN_sNAN_FLAG)
-
-/*
-
-=item C<am_qNAN(bn)>
-
-True if C<bn> is a quiet NaN.
-
-=cut
-
-*/
-
-#define am_qNAN(bn) ((bn)->flags & BN_qNAN_FLAG)
-
-/*
-
-=item C<char* BN_lazydbprint(BIGNUM* foo)>
-
-For the sake of debugging
-
-=cut
-
-*/
-
-char* BN_lazydbprint(BIGNUM* foo)
-{
-    char*s;
-    BN_to_scientific_string(foo, &s);
-    return s;
-}
-
-/* Internal functions + types */
-typedef enum {   /* Indicate to idivide when to stop */
-    BN_DIV_DIVIDE,
-    BN_DIV_DIVINT,
-    BN_DIV_REMAIN
-} BN_DIV_ENUM;
-
-/* Used to restore INTENT(IN) arguments to functions */
-typedef struct BN_SAVE_PREC {
-    BIGNUM one;
-    BIGNUM two;
-} BN_SAVE_PREC;
-
-int
-BN_imultiply(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context);
-int
-BN_idivide(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-            BN_CONTEXT *context,
-            BN_DIV_ENUM operation, BIGNUM* rem);
-int BN_iround(PINTD_ BIGNUM *bn, BN_CONTEXT* context);
-INTVAL BN_to_scieng_string(PINTD_ BIGNUM* bn, char **dest, int eng);
-int BN_strip_lead_zeros(PINTD_ BIGNUM* victim, BN_CONTEXT*);
-int BN_strip_tail_zeros(PINTD_ BIGNUM* victim, BN_CONTEXT*);
-int BN_round_up(PINTD_ BIGNUM *victim, BN_CONTEXT* context);
-int BN_round_down(PINTD_ BIGNUM *victim, BN_CONTEXT* context);
-int BN_make_integer(PINTD_ BIGNUM* bn, BN_CONTEXT* context);
-int BN_arith_setup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-                   BN_CONTEXT *context, BN_SAVE_PREC* restore);
-int BN_arith_cleanup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-                     BN_CONTEXT *context, BN_SAVE_PREC* restore);
-int BN_iadd(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-            BN_CONTEXT *context);
-int BN_isubtract(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-                 BN_CONTEXT *context);
-int BN_align(PINTD_ BIGNUM* one, BIGNUM* two);
-INTVAL BN_nonfatal(PINTD_ BN_CONTEXT *context, BN_EXCEPTIONS except,
-                   const char *msg);
-int BN_set_verybig(PINTD_ BIGNUM* bn, BN_CONTEXT *context);
-
-/*
-
-=back
-
-=head2 Creation and Memory Management Functions
-
-=over 4
-
-=item C<BIGNUM*
-BN_new(PINTD_ INTVAL length)>
-
-Create a new C<BIGNUM>.  C<length> is number of I<decimal> digits
-required. The bignumber will be equal to zero.
-
-=cut
-
-*/
-
-BIGNUM*
-BN_new(PINTD_ INTVAL length)
-{
-    BIGNUM* bn;
-    bn = (BIGNUM*)BN_alloc(PINT_ sizeof (BIGNUM));
-    if (NULL == bn) {
-        BN_EXCEPT(PINT_ BN_INSUFFICIENT_STORAGE, "Cannot allocate new BigNum");
-    }
-    bn->nibs = 1 + length / BN_D_PER_NIB;
-    bn->buffer = (BN_NIB*)BN_alloc(PINT_ sizeof (BN_NIB) * bn->nibs);
-    if (NULL == bn->buffer) {
-        BN_EXCEPT(PINT_ BN_INSUFFICIENT_STORAGE, "Cannot allocate new BigNum");
-    }
-    bn->sign = 0;
-    bn->expn = 0;
-    bn->digits = 1;
-    bn->flags = 0;
-
-    return bn;
-}
-
-/*
-
-=item C<void
-BN_grow(PINTD_ NOTNULL(BIGNUM *in), INTVAL length)>
-
-Grows bn so that it can contain C<length> I<decimal> digits, does not
-modify the value of the bignumber.
-
-=cut
-
-*/
-
-void
-BN_grow(PINTD_ NOTNULL(BIGNUM *in), INTVAL length)
-{
-    PARROT_ASSERT(in);
-    if (length <= in->nibs * BN_D_PER_NIB) {
-        return;
-    }
-    if (length > BN_MAX_DIGITS) {
-        BN_EXCEPT(PINT_ BN_OVERFLOW, "Attempt to grow BIGNUM beyond limits");
-    }
-    in->nibs = 1+ length / BN_D_PER_NIB;
-    in->buffer = (BN_NIB*)BN_realloc(PINT_ in->buffer,
-                                     sizeof (BN_NIB) *(in->nibs));
-    if (NULL==in->buffer) {
-        BN_EXCEPT(PINT_ BN_INSUFFICIENT_STORAGE, "Cannot grow BIGNUM");
-    }
-    return;
-}
-
-/*
-
-=item C<void
-BN_destroy(PINTD_ BIGNUM *bn)>
-
-Frees all the memory used by the BIGNUM.
-
-=cut
-
-*/
-
-void
-BN_destroy(PINTD_ BIGNUM *bn)
-{
-    PARROT_ASSERT(bn!=NULL);
-
-    BN_free(PINT_ bn->buffer);
-    BN_free(PINT_ bn);
-    return;
-}
-
-/*
-
-=item C<BN_CONTEXT*
-BN_create_context(PINTD_ INTVAL precision)>
-
-Creates a new context object, with specified I<precision>, other fields
-are initialised as follows:
-
- elimit   = BN_HARD_EXPN_LIMIT (defined during configure)
- rounding = ROUND_HALF_UP
- extended = 1
- flags    = 0
- traps    = Division by zero, invalid operation, overflow, underflow
-            and rounded are enabled.
-            Lost digits and inexact are disabled.
-
-The context object can be destroyed with C<free()>.
-
-=cut
-
-*/
-
-BN_CONTEXT*
-BN_create_context(PINTD_ INTVAL precision)
-{
-    BN_CONTEXT *result;
-
-    result = (BN_CONTEXT*)BN_alloc(PINT_ sizeof (BN_CONTEXT));
-    if (result == NULL) {
-        BN_EXCEPT(PINT_ BN_INSUFFICIENT_STORAGE,
-                  "Cannot create a context");
-    }
-
-    result->precision = precision;
-
-    result->elimit = BN_HARD_EXPN_LIMIT;
-    result->rounding = ROUND_HALF_UP;
-    result->extended = 1;
-    result->flags = 0;
-    result->traps = (BN_F_DIVISION_BY_ZERO  |
-                      BN_F_EXCEPTION_INVALID_OPERATION |
-                      BN_F_OVERFLOW          |
-                      BN_F_ROUNDED           |
-                      BN_F_UNDERFLOW);
-    return result;
-}
-
-/*
-
-=item C<INTVAL
-BN_set_digit(PINT_ BIGNUM* bn, INTVAL pos, INTVAL value)>
-
-Sets digit at C<pos> (zero based) to C<value>. Number is grown if digits
-> allocated space are accessed, but intermediate digits will have
-undefined values. If C<pos> is beyond C<digits> then C<digits> is also
-updated.
-
-=cut
-
-*/
-
-INTVAL
-BN_set_digit(PINT_ BIGNUM* bn, INTVAL pos, INTVAL value)
-{
-    PARROT_ASSERT(bn != NULL);
-    if (pos > bn->nibs * BN_D_PER_NIB) {
-        BN_grow(bn, pos);
-    }
-    PARROT_ASSERT(value < 10);
-    PARROT_ASSERT(value > -1);
-    BN_setd(bn, pos, value);
-    if (bn->digits < pos+1) {
-        bn->digits = pos+1;
-    }
-    return value;
-}
-
-/*
-
-=item C<INTVAL
-BN_get_digit(PINTD_ BIGNUM* bn, INTVAL pos)>
-
-Get the value of the decimal digit at C<pos>, returns -1 if C<pos> is
-out of bounds.
-
-=cut
-
-*/
-
-INTVAL
-BN_get_digit(PINTD_ BIGNUM* bn, INTVAL pos)
-{
-    PARROT_ASSERT(bn != NULL);
-    if (pos > bn->digits || pos < 0) return -1;
-    return BN_getd(bn, pos);
-}
-
-/*
-
-=item C<int BN_set_inf(PINTD_ BIGNUM* bn)>
-
-=item C<int BN_set_qNAN(PINTD_ BIGNUM* bn)>
-
-=item C<int BN_set_sNAN(PINTD_ BIGNUM* bn)>
-
-Sets its argument to appropriate value.
-
-Infinity is represented as having zero digits, an undefined exponent
-and private C<flags> set to C<BN_inf_FLAGS>.
-
-sNAN is represented as having zero digits, an undefined exponent, an
-undefined sign and both qNAN and sNAN bits set.
-
-qNAN is represented as having zero digits, an undefined exponent
-and only the qNAN bit set.
-
-=cut
-
-*/
-
-int BN_set_inf(PINTD_ BIGNUM* bn)
-{
-    PARROT_ASSERT(bn != NULL);
-    bn->digits = 0;
-    bn->flags = (bn->flags & (~(UINTVAL)255)) | BN_INF_FLAG;
-    return;
-}
-
-int BN_set_qNAN(PINTD_ BIGNUM* bn)
-{
-    PARROT_ASSERT(bn != NULL);
-    bn->digits = 0;
-    bn->flags = (bn->flags & (~(UINTVAL)255)) | BN_qNAN_FLAG;
-    return;
-}
-
-int BN_set_sNAN(PINTD_ BIGNUM* bn)
-{
-    PARROT_ASSERT(bn != NULL);
-    bn->digits = 0;
-    bn->flags = (bn->flags & (~(UINTVAL)255)) | BN_qNAN_FLAG | BN_sNAN_FLAG;
-    return;
-}
-
-/*
-
-=item C<int
-BN_set_verybig(PINTD_ BIGNUM* bn, BN_CONTEXT *context)>
-
-Used when an operation has overflowed, sets C<bn> according to
-C<< context->rounding >> and the sign of C<bn>:
-
- ROUND_HALF_UP, ROUND_HALF_EVEN => sign Infinity
- ROUND_DOWN => sign, largest finite number in given precision (or Inf, if
-                 infinite precision is specified)
- ROUND_CEILING => same as round down, if sign is 1, +Inf otherwise
- ROUND_FLOOR => same as round down, if sign is 0, -Inf otherwise
-
-=cut
-
-*/
-
-int
-BN_set_verybig(PINTD_ BIGNUM* bn, BN_CONTEXT *context)
-{
-    int massive = 0; /* 0 => inf, 1=> 99999999999 etc...*/
-    switch (context->rounding) {
-      case ROUND_HALF_UP:
-      case ROUND_HALF_EVEN:
-        break;
-      case ROUND_FLOOR:
-        if (!bn->sign) massive = 1;
-        break;
-      case ROUND_CEILING:
-        if (bn->sign) massive = 1;
-        break;
-      case ROUND_DOWN:
-        massive = 1;
-        break;
-      default:
-        BN_EXCEPT(PINT_ BN_EXCEPTION_INVALID_OPERATION,
-                  "Unknown rounding during overflow");
-    }
-    if (context->precision > 0 && massive) {
-        INTVAL i;
-        BN_grow(PINT_ bn, context->precision);
-        for (i = 0; i< context->precision; i++) {
-            BN_setd(bn, i, 9);
-        }
-        bn->digits = context->precision;
-        bn->expn = context->elimit - context->precision + 1;
-    }
-    else {
-        BN_set_inf(PINT_ bn);
-    }
-}
-
-/*
-
-=item C<BIGNUM*
-BN_copy(PINTD_ BIGNUM* one, BIGNUM* two)>
-
-Copies two into one, returning one for convenience.
-
-=cut
-
-*/
-
-BIGNUM*
-BN_copy(PINTD_ BIGNUM* one, BIGNUM* two)
-{
-    PARROT_ASSERT(one != NULL); PARROT_ASSERT(two != NULL);
-
-    BN_grow(PINT_ two, one->digits);
-    memcpy((void*)one->buffer, (void*)two->buffer,
-           (1+two->digits / BN_D_PER_NIB) * sizeof (BN_NIB));
-    one->flags &= ~(UINTVAL)0xF;
-    one->flags |= two->flags & 0xF;
-    one->digits = two->digits;
-    one->expn = two->expn;
-    one->sign = two->sign;
-    return one;
-}
-
-/*
-
-=item C<BIGNUM*
-BN_new_from_int(PINTD_ INTVAL value)>
-
-Create a new bignum from a (signed) integer value (C<INTVAL>)
-We assume that the implementation limits are somewhat larger than
-those required to store a single integer into a bignum.
-
-=cut
-
-*/
-
-BIGNUM*
-BN_new_from_int(PINTD_ INTVAL value)
-{
-    BIGNUM *new;
-    int i, current;
-    new = BN_new(PINT_ BN_D_PER_INT);
-    if (value < 0) {
-        new->sign = 1;
-        value = -value;
-    }
-    i = 0;
-    while (value) {
-        current = value % 10;
-        BN_setd(new, i, current);
-        value = value / 10;
-        i++;
-    }
-    new->digits = i;
-    new->expn = 0;
-    return new;
-}
-
-/*
-
-=item C<void
-BN_PRINT_DEBUG(BIGNUM *bn, char* mesg)>
-
-Dump the bignum for testing, along with a little message.
-
-=cut
-
-*/
-
-void
-BN_PRINT_DEBUG(BIGNUM *bn, char* mesg)
-{
-    INTVAL i;
-    printf("%s: nibs %i digits %i sign %i expn %i \n", mesg,
-           bn->nibs, bn->digits, bn->sign, bn->expn);
-    if (bn->digits == 0) {
-        printf("Special value, flags: %x", bn->flags & 127);
-    }
-    else {
-        for (i=bn->digits-1; i>-1; i--) {
-            printf("%d", BN_getd(bn, i));
-            if (!(i%5)) printf(" ");
-            if (!(i%70)) printf("\n");
-        }
-    }
-    printf("\n");
-}
-
-/*
-
-=item C<INTVAL
-BN_nonfatal(PINTD_ BN_CONTEXT *context, BN_EXCEPTIONS except, const char *msg)>
-
-When an exceptional condition occurs after which execution could
-continue.  If context specifies that death occurs, then so be it.
-
-=cut
-
-*/
-
-INTVAL
-BN_nonfatal(PINTD_ BN_CONTEXT *context, BN_EXCEPTIONS except, const char *msg)
-{
-    /* See extended standard for details */
-    switch (except) {
-    case BN_CONVERSION_OVERFLOW :
-        /* Asked to hold coeff|expn too large value */
-        context->flags |= BN_F_OVERFLOW | BN_F_INEXACT | BN_F_ROUNDED;
-        if (context->traps & (BN_F_OVERFLOW | BN_F_INEXACT | BN_F_ROUNDED)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_CONVERSION_SYNTAX:
-        /* string not conforming to numeric form */
-        context->flags |= BN_F_EXCEPTION_INVALID_OPERATION;
-        if (context->traps & (BN_F_EXCEPTION_INVALID_OPERATION)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_CONVERSION_UNDERFLOW:
-        /* expn of string too small to be held  */
-        context->flags |= BN_F_UNDERFLOW;
-        if (context->traps & (BN_F_UNDERFLOW)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_DIVISION_BY_ZERO:
-        /* dividend of div/div-int or pow zero  */
-        context->flags |= BN_F_DIVISION_BY_ZERO;
-        if (context->traps & (BN_F_DIVISION_BY_ZERO)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_DIVISION_IMPOSSIBLE:
-        /* integer result of div-int or rem > precision */
-        context->flags |= BN_F_EXCEPTION_INVALID_OPERATION;
-        if (context->traps & (BN_F_EXCEPTION_INVALID_OPERATION)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_DIVISION_UNDEFINED:
-        /* div by zero with zero on top also */
-        context->flags |= BN_F_EXCEPTION_INVALID_OPERATION;
-        if (context->traps & (BN_F_EXCEPTION_INVALID_OPERATION)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_INEXACT:
-        /* some sort of rounding: with loss of information */
-        context->flags |= BN_F_INEXACT;
-        if (context->traps & (BN_F_INEXACT)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_INSUFFICIENT_STORAGE:
-        /* not enough space to hold intermediate results */
-        /* Often this will be raised directly (ie. fatally) */
-        context->flags |= BN_F_EXCEPTION_INVALID_OPERATION;
-        if (context->traps & (BN_F_EXCEPTION_INVALID_OPERATION)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_INVALID_CONTEXT:
-        /* context given was not valid (unknown round) */
-        context->flags |= BN_F_EXCEPTION_INVALID_OPERATION;
-        if (context->traps & (BN_F_EXCEPTION_INVALID_OPERATION)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_EXCEPTION_INVALID_OPERATION:
-        /* operation which is not valid */
-        context->flags |= BN_F_EXCEPTION_INVALID_OPERATION;
-        if (context->traps & (BN_F_EXCEPTION_INVALID_OPERATION)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_LOST_DIGITS:
-        /* digits lost in rounding  */
-        context->flags |= BN_F_LOST_DIGITS;
-        if (context->traps & (BN_F_LOST_DIGITS)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_OVERFLOW:
-        /* expn becomes larger than max allowed */
-        context->flags |= BN_F_OVERFLOW | BN_F_ROUNDED | BN_F_INEXACT;
-        if (context->traps & (BN_F_OVERFLOW | BN_F_ROUNDED | BN_F_INEXACT)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_ROUNDED:
-        /* something was rounded */
-        context->flags |= BN_F_ROUNDED;
-        if (context->traps & (BN_F_ROUNDED)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    case BN_UNDERFLOW:
-        /* expn becomes smaller than min allowed */
-        context->flags |= BN_F_UNDERFLOW | BN_F_ROUNDED | BN_F_INEXACT;
-        if (context->traps &(BN_F_UNDERFLOW | BN_F_ROUNDED | BN_F_INEXACT)) {
-            BN_EXCEPT(PINT_ except, msg);
-        }
-        break;
-    default:
-        BN_EXCEPT(PINT_ BN_EXCEPTION_INVALID_OPERATION, "An unknown error occurred");
-    }
-
-}
-
-/*
-
-=item C<void
-BN_exception(PINTD_ BN_EXCEPTIONS exception, const char* message)>
-
-Throw `exception'. Should be accessed via a C<BN_EXCEPT> macro, this
-version is provided until Parrot exceptions are sorted out properly.
-
-=cut
-
-*/
-
-void
-BN_exception(PINTD_ BN_EXCEPTIONS exception, const char* message)
-{
-    printf("Exception %d %s\n", exception, message);
-    exit(EXIT_SUCCESS);
-}
-
-/*
-
-=item C<INTVAL
-BN_to_scientific_string(PINTD_ BIGNUM*bn, char **dest)>
-
-Converts bn into a scientific representation, stored in dest.
-
-=item C<INTVAL
-BN_to_engineering_string(PINTD_ BIGNUM*bn, char **dest)>
-
-Converts C<*bn> into a engineering representation, stored in C<**dest>.
-
-These functions return C<char*> strings only, parrot may want to
-reimplement these so that locales and the like are nicely coped with.
-
-Any reimplementation should be in a seperate file, this section of
-the main file can be C<#ifdef>ed out if this is done.
-
-Memory pointed to by C<dest> is not freed by this function.
-
-=cut
-
-*/
-
-
-INTVAL
-BN_to_scientific_string(PINTD_ BIGNUM*bn, char **dest)
-{
-    BN_to_scieng_string(PINT_ bn, dest, 0);
-}
-
-INTVAL
-BN_to_engineering_string(PINTD_ BIGNUM*bn, char **dest)
-{
-    BN_to_scieng_string(PINT_ bn, dest, 1);
-}
-
-/*
-
-=item C<INTVAL
-BN_to_scieng_string(PINTD_ BIGNUM* bn, char **dest, int eng)>
-
-Does the heavy string handling work, C<eng> defines the conversion to
-perform.
-
-=cut
-
-*/
-
-INTVAL
-BN_to_scieng_string(PINTD_ BIGNUM* bn, char **dest, int eng)
-{
-    char* cur;
-    INTVAL adj_exp = 0; /* as bn->expn is relative to 0th digit */
-    INTVAL cur_dig = 0;
-    PARROT_ASSERT(bn!=NULL);
-    /* Special values have digits set to zero, so this should be enough */
-    *dest = (char*)BN_alloc(PINT_ bn->digits + 5 + BN_D_PER_INT);
-    if (dest == NULL) {
-        BN_EXCEPT(PINT_ BN_INSUFFICIENT_STORAGE,
-                  "Cannot create buffer to hold output string");
-    }
-
-    cur = *dest;
-
-    /* Do we have a special value? */
-    if (am_NAN(bn)) {
-        if (am_qNAN(bn)) {
-            strcpy(cur, "NaN");
-        }
-        else { /* must be signalling */
-            strcpy(cur, "sNaN");
-        }
-        return 1;
-    }
-
-    if (am_INF(bn)) {
-        if (bn->sign) *cur++ = '-';
-        strcpy(cur, "Infinity");
-        return 1;
-    }
-
-    /* Nope, nothing out of the ordinary, full steam ahead! */
-    adj_exp = bn->digits + bn->expn -1;
-    /* For values near to zero, we do not use exponential notation */
-    if (bn->expn <= 0 && adj_exp >= -6) {
-        if (bn->sign) {
-            *cur++ = '-';
-        }
-        /*pad with zeros if appropriate, plonk a point where we want it */
-        if (bn->digits + bn->expn <= 0) {
-            int i;
-            *cur++ = '0';
-            if (bn->digits+bn->expn<0) *cur++ = '.';
-            for (i=1; i <= -(bn->digits + bn->expn); i++) *cur++ = '0';
-        }
-        for (cur_dig = bn->digits-1; cur_dig >-1; cur_dig--) {
-            if (1+cur_dig + bn->expn == 0) *cur++ ='.';
-            *cur++ = '0' + BN_getd(bn, cur_dig);
-        }
-        *cur = 0;
-    }
-    else { /* Use exponential notation, different for sci and eng */
-        if (bn->sign) *cur++ = '-'; /* We don't prefix '+' */
-
-        if (eng) {
-            int deficit;
-            if (adj_exp < 0) {
-                deficit = (-adj_exp) % 3;
-                if (deficit == 1) {
-                    deficit = 2;
-                    adj_exp -= 2;
-                }
-                else if (deficit == 2) {
-                    deficit = 1;
-                    adj_exp -=1;
-                }
-            }
-            else {
-                deficit = adj_exp % 3;
-                adj_exp -= deficit;
-            }
-            /* so, d = 0. x.yyyy, d=1 xx.y d=2 xxx.yyy special case if xxx*/
-
-            *cur++ = '0' + BN_getd(bn, bn->digits-1);
-            if (deficit == 0) *cur++ = '.';
-
-            if (bn->digits == 1) {
-                *cur++ = '0';
-                if (deficit == 1) *cur++ = '.';
-                *cur++ = '0';
-            }
-            else if (bn->digits == 2) {
-                *cur++ = '0' + BN_getd(bn, bn->digits-2);
-                if (deficit == 1) *cur++ = '.';
-                *cur++ = '0';
-            }
-            else {
-                *cur++ = '0' + BN_getd(bn, bn->digits-2);
-                if (deficit == 1) *cur++ = '.';
-                *cur++ = '0' + BN_getd(bn, bn->digits-3);
-                if (bn->digits != 3 && deficit == 2) *cur++ = '.';
-
-                for (cur_dig=bn->digits-4; cur_dig>-1; cur_dig--) {
-                    *cur++ = '0' + BN_getd(bn, cur_dig);
-                }
-            }
-
-            *cur++ = 'E';
-            sprintf(cur, "%+i", adj_exp);
-
-        }
-        else { /* Scientific */
-            if (bn->digits == 1) { /* We don't want 1.E+7 */
-                *cur++ = '0'+ BN_getd(bn, 0);
-            }
-            else { /* We have x.xE */
-                *cur++ = '0' + BN_getd(bn, bn->digits-1);
-                *cur++ = '.';
-                for (cur_dig = bn->digits-2; cur_dig > -1; cur_dig--) {
-                    *cur++ = '0' + BN_getd(bn, cur_dig);
-                }
-            }
-            *cur++ = 'E'; /* Eza Good, Eza Good */
-            sprintf(cur, "%+i", adj_exp);
-        }
-    }
-
-    return 0;
-}
-
-/*
-
-=item C<BIGNUM*
-BN_from_string(PINTD_ char* s2, BN_CONTEXT *context)>
-
-Convert a scientific string to a BIGNUM.  This function deals entirely
-with common-or-garden C byte strings, so the library can work
-anywhere.  Another version will be eventually required to cope with
-the parrot string fun.
-
-This is the Highly Pedantic string conversion.  If C<context> has
-C<extended> as a true value, then the full range of extended number is
-made available, and any string which does not match the numeric syntax
-is converted to a quiet NaN.
-
-Does not yet check for exponent overflow.
-
-=cut
-
-*/
-
-BIGNUM*
-BN_from_string(PINTD_ char* s2, BN_CONTEXT *context)
-{
-    BIGNUM *result;
-    BIGNUM *temp;
-
-    INTVAL pos = 0;             /* current digit in buffer */
-    int negative = 0;        /* is it negative */
-    int seen_dot = 0;        /* have we seen a '.' */
-    int seen_e = 0;          /* have we seen an 'E' or 'e' */
-    int exp_sign = 0;        /* is the exponent negative */
-    int in_exp = 0;          /* are we reading exponent digits */
-    int in_number = 0;       /* are we reading coeff digits */
-    INTVAL exponent = 0;        /* the exponent */
-    INTVAL fake_exponent = 0;   /* adjustment for digits after a '.' */
-    INTVAL i = 0;
-    int non_zero_digits = 0; /* have we seen *any* digits */
-    int seen_plus = 0;       /* was number prefixed with '+' */
-    int infinity =0;
-    int qNAN = 0;
-    int sNAN = 0;
-
-    temp = BN_new(PINT_ 1);     /* We store coeff reversed in temp */
-
-    while (*s2) { /* charge through the string */
-        if (isdigit((unsigned char)*s2) && !in_exp) {
-            /* We're somewhere in the main string of numbers */
-            int digit = *s2 - '0'; /* byte me! */
-            if (digit ==0 && !non_zero_digits) { /* ignore leading zeros */
-                in_number = 1;
-                s2++;
-                if (seen_dot) fake_exponent--;
-                continue;
-            }
-            else {
-                non_zero_digits = 1;
-            }
-            in_number = 1;
-            BN_grow(PINT_ temp, pos+10);
-            BN_setd(temp, pos, digit);
-            pos++;
-            if (seen_dot) {
-                fake_exponent--;
-            }
-        }
-        else if (isdigit((unsigned char)*s2) && in_exp) {
-            exponent = 10 * exponent + (*s2 - '0'); /*XXX: overflow check */
-        }
-        else if (!in_number) {
-            /* we've not yet seen any digits */
-            if (*s2 == '-') {
-                if (seen_plus || negative || seen_dot) {
-                    if (!context->extended) {
-                        BN_EXCEPT(PINT_ BN_CONVERSION_SYNTAX,
-                                  "Incorrect number format");
-                    }
-                    else {
-                        qNAN = 1; break;
-                    }
-                }
-                negative = 1;
-            }
-            else if (*s2 == '.') {
-                seen_dot = 1;
-            }
-            else if (*s2 == '+') {
-                if (seen_plus || negative || seen_dot) {
-                    if (!context->extended) {
-                        BN_EXCEPT(PINT_ BN_CONVERSION_SYNTAX,
-                                  "Incorrect number format");
-                    }
-                    else {
-                        qNAN = 1; break;
-                    }
-                }
-                seen_plus = 1; /* be very quiet */
-            }
-            else if (context->extended) {
-                if (*s2 == 'i' || *s2 == 'I') {
-                    if (!strncasecmp("inf", s2, 4)) { /* We include the \0 */
-                        infinity = 1;
-                        /* For certain, restricted values of infinity */
-                        break;
-                    }
-                    else if (!strncasecmp("infinity", s2, 9)) {
-                        infinity = 1;
-                        break;
-                    }
-                    else {
-                        qNAN = 1;
-                        break;
-                    }
-                }
-                else if (*s2 == 'n' || *s2 == 'N') {
-                    qNAN = 1; /* Don't need to check, as default.. */
-                    break;
-                }
-                else if (*s2 == 's' || *s2 == 'S') {
-                    if (!strncasecmp("snan", s2, 5)) {
-                        sNAN = 1;
-                        break;
-                    }
-                    else {
-                        qNAN = 1;
-                        break;
-                    }
-                }
-                qNAN = 1;
-                break;
-            } /* don't know, not in extended mode... */
-            else {
-                BN_EXCEPT(PINT_ BN_CONVERSION_SYNTAX,
-                          "Incorrect number format");
-            }
-        }
-        else {
-            /* we've seen some digits, are we done yet? */
-            if (!seen_dot && *s2 == '.' && !in_exp) {
-                seen_dot = 1;
-            }
-            else if (!seen_e && (*s2 == 'e' || *s2 == 'E')) {
-                seen_e = 1;
-                in_exp = 1;
-            }
-            else if (seen_e && !exp_sign) {
-                if (*s2 == '+') {
-                    exp_sign = 1;
-                }
-                else if (*s2 == '-') {
-                    exp_sign = -1;
-                }
-                else {
-                    if (!context->extended) {
-                        BN_EXCEPT(PINT_ BN_CONVERSION_SYNTAX,
-                                  "Incorrect number format");
-                    }
-                    else {
-                        qNAN = 1; break;
-                    }
-                }
-            }
-            else { /* We fall through here if we don't recognise something */
-                if (!context->extended) {
-                    BN_EXCEPT(PINT_ BN_CONVERSION_SYNTAX,
-                              "c Incorrect number format");
-                }
-                else {
-                    qNAN = 1; break;
-                }
-            }
-        }
-        s2++; /* rinse, lather... */
-    }
-
-    if (!(qNAN || sNAN || infinity)) {
-        if (in_number && !pos) { /* Only got zeros */
-            pos = 1;
-            BN_setd(temp, 0, 0);
-        }
-
-        if (pos==0) { /* This includes ".e+20" */
-            if (!context->extended) {
-                BN_EXCEPT(PINT_ BN_CONVERSION_SYNTAX, "no digits in string");
-            }
-            else {
-                qNAN = 1;
-            }
-        }
-    }
-
-    result = BN_new(pos+1);
-
-    /* copy reversed string of digits backwards into result */
-    if (!(qNAN || sNAN || infinity)) { /* Normal */
-        temp->digits = pos;
-
-        for (i=0; i< temp->digits; i++) {
-            BN_setd(result, i, BN_getd(temp, temp->digits-i-1));
-        }
-
-        result->sign = negative;
-        result->digits = pos;
-        if (exp_sign == -1) {
-            result->expn = fake_exponent - exponent;
-        }
-        else {
-            result->expn = fake_exponent + exponent;
-        }
-    }
-    else { /* Special */
-        if (infinity) {
-            BN_set_inf(PINT_ result);
-            result->sign = negative;
-        }
-        else if (sNAN) {
-            BN_set_sNAN(PINT_ result);
-        }
-        else {
-            BN_set_qNAN(PINT_ result);
-        }
-    }
-
-
-    BN_destroy(PINT_ temp);
-    BN_really_zero(PINT_ result, context->extended);
-    return result;
-}
-
-
-/*
-
-=item C<int
-BN_strip_lead_zeros(PINTD_ BIGNUM* bn, BN_CONTEXT *context)>
-
-Removes any zeros before the msd and after the lsd.
-
-=cut
-
-*/
-
-int
-BN_strip_lead_zeros(PINTD_ BIGNUM* bn, BN_CONTEXT *context)
-{
-    INTVAL msd, i;
-
-    if (bn->digits == 0) return 0; /* Cannot "fail" with special nums */
-
-    msd = bn->digits-1;
-
-    while (0==BN_getd(bn, msd) && msd > 0) {
-        msd--;
-    }
-
-    bn->digits -= bn->digits-1 - msd;
-}
-
-/*
-
-=item C<int
-BN_strip_tail_zeros(PINTD_ BIGNUM *bn, BN_CONTEXT *context)>
-
-Removes trailing zeros and increases the exponent appropriately.
-Does not remove zeros before the decimal point.
-
-=cut
-
-*/
-
-int
-BN_strip_tail_zeros(PINTD_ BIGNUM *bn, BN_CONTEXT *context)
-{
-    INTVAL lsd, i;
-
-    lsd = 0;
-
-    while (0==BN_getd(bn, lsd)) {
-        lsd++;
-    }
-    if (bn->expn >= 0) {
-        lsd = 0; /* units column */
-    }
-    else if (bn->expn + lsd > 0) {
-        lsd = -bn->expn;
-    }
-    for (i=0; i< bn->digits -lsd; i++) {
-        BN_setd(bn, i, BN_getd(bn, i+lsd));
-    }
-
-    if (CHECK_OVERFLOW(bn, lsd, context)) {
-        BN_EXCEPT(PINT_ BN_OVERFLOW, "overflow when striping zeros");
-    }
-    bn->expn += lsd;
-    bn->digits -= lsd;
-}
-
-/*
-
-=item C<int
-BN_make_integer(PINTD_ BIGNUM* bn, BN_CONTEXT* context)>
-
-Convert the number to a plain integer I<if> precision such that this
-is possible.
-
-=cut
-
-*/
-
-int
-BN_make_integer(PINTD_ BIGNUM* bn, BN_CONTEXT* context)
-{
-    /* Normal bignum */
-    if (bn->expn > 0 && bn->digits + bn->expn <= context->precision) {
-        INTVAL i;
-        BN_grow(PINT_ bn, context->precision);
-        for (i=bn->digits-1; i>= 0; i--) {
-            BN_setd(bn, i+bn->expn, BN_getd(bn, i));
-        }
-        for (i=0; i<bn->expn; i++) {
-            BN_setd(bn, i, 0);
-        }
-        bn->digits += bn->expn;
-        bn->expn = 0;
-    }
-    else {
-        return; /* XXX: fixed precision, bigints */
-    }
-}
-
-/*
-
-=item C<int
-BN_really_zero(PINTD_ BIGNUM* bn, int allow_neg_zero)>
-
-Sets any number which should be zero to a canonical zero.
-
-To check if a number is equal to zero, use C<BN_is_zero()>.
-
-=cut
-
-*/
-
-int
-BN_really_zero(PINTD_ BIGNUM* bn, int allow_neg_zero)
-{
-    INTVAL i;
-    if (bn->digits == 0) return;
-    for (i=0; i< bn->digits; i++)
-        if (BN_getd(bn, i) != 0) return;
-
-    bn->digits = 1;
-    bn->expn = 0;
-    if (!allow_neg_zero) bn->sign = 0;
-    return;
-}
-
-/*
-
-=item C<void
-BN_round(PINTD_ BIGNUM *bn, BN_CONTEXT* context)>
-
-Rounds C<*bn> according to C<*context>.
-
-=cut
-
-*/
-
-void
-BN_round(PINTD_ BIGNUM *bn, BN_CONTEXT* context)
-{
-    /* In exported version, must check for sNAN */
-    if (bn->digits == 0 && am_sNAN(bn)) {
-        BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                    "sNaN in round");
-        BN_set_sNAN(PINT_ bn);
-        return;
-    }
-    else {
-        BN_iround(PINT_ bn, context);
-        return;
-    }
-}
-
-/*
-
-=item C<int
-BN_iround(PINTD_ BIGNUM *bn, BN_CONTEXT* context)>
-
-Rounds victim according to context.
-
-Round assumes that any leading zeros are significant (after an
-addition operation, for instance).
-
-If C<precision> is positive, the digit string is rounded to have no more
-than C<precision> digits.  If C<precision> is equal to zero, the number
-is treated as an integer, and any digits after the number's decimal
-point are removed.  If C<precision> is negative, the number is rounded
-so that there are no more than - C<precision> digits after the decimal
-point.
-
-eg. for  1.234567E+3 with rounding of C<ROUND_DOWN>
-
-    precision:  4 =>  1.234E+3      1234
-    precision:  6 =>  1.234567E+3   1234.56
-    precision:  9 =>  1.234567E+3   1234.567
-    precision:  0 =>  1234          1234
-    precision: -1 =>  1.2345E+3     1234.5
-    precision: -9 =>  1.234567E+3   1234.567
-
-=cut
-
-*/
-
-int
-BN_iround(PINTD_ BIGNUM *bn, BN_CONTEXT* context)
-{
-    PARROT_ASSERT(bn!= NULL);
-    PARROT_ASSERT(context != NULL);
-
-    if (bn->digits == 0) {
-        return 0; /* rounding special values always works */
-    }
-
-    if (context->precision < 1) { /* Rounding a BigInt or fixed */
-        BN_round_as_integer(PINT_ bn, context);
-        return;
-    }
-    /* Rounding a BigNum or sdaNum*/
-    if (bn->digits > context->precision) {
-        /* We're rounding, right... do we care? */
-        BN_nonfatal(PINT_ context, BN_ROUNDED, "Argument rounded");
-        { /* Check for lost digits */
-            INTVAL digit;
-            for (digit = 0; digit < bn->digits - context->precision; digit++) {
-                if (BN_getd(bn, digit) != 0) {
-                    BN_nonfatal(PINT_ context, BN_LOST_DIGITS,
-                                "digits lost while rounding");
-                    BN_nonfatal(PINT_ context, BN_INEXACT,
-                                "Loss of precision while rounding");
-                    break;
-                }
-            }
-        }
-
-        if (context->rounding == ROUND_DOWN) {
-            return BN_round_down(PINT_ bn, context);
-        }
-        else if (context->rounding == ROUND_HALF_UP) {
-            if (BN_getd(bn, bn->digits - context->precision -1) > 4) {
-                return BN_round_up(PINT_ bn, context);
-            }
-            else {
-                return BN_round_down(PINT_ bn, context);
-            }
-        }
-        else if (context->rounding == ROUND_HALF_EVEN) {
-
-            if (BN_getd(bn, bn->digits - context->precision -1) > 5) {
-                return BN_round_up(PINT_ bn, context);
-            }
-            else if (BN_getd(bn, bn->digits - context->precision -1) < 5) {
-                return BN_round_down(PINT_ bn, context);
-            }
-            else {
-                INTVAL i = bn->digits - context->precision -2;
-                if (i > -1) {
-                    while (i>=0) {
-                        if (BN_getd(bn, i) != 0) {
-                            return BN_round_up(PINT_ bn, context);
-                        }
-                        i--;
-                    }
-                }
-                switch (BN_getd(bn, bn->digits-context->precision)) {
-                case 0 :
-                case 2 :
-                case 4 :
-                case 6 :
-                case 8 :
-                    return BN_round_down(PINT_ bn, context);
-                default:
-                    return BN_round_up(PINT_ bn, context);
-                }
-            }
-
-        }
-        else if (context->rounding == ROUND_CEILING) {
-            INTVAL i;
-            if (bn->sign) {
-                return BN_round_down(PINT_ bn, context);
-            }
-            for (i = bn->digits - context->precision -1; i > -1; i--) {
-                if (BN_getd(bn, i) != 0) {
-                    return BN_round_up(PINT_ bn, context);
-                }
-            }
-            return BN_round_down(PINT_ bn, context);
-        }
-        else if (context->rounding == ROUND_FLOOR) {
-            INTVAL i;
-            if (!bn->sign) {
-                return BN_round_down(PINT_ bn, context);
-            }
-            for (i = bn->digits - context->precision; i > -1; i--) {
-                if (BN_getd(bn, i) != 0) {
-                    return BN_round_up(PINT_ bn, context);
-                }
-            }
-            return BN_round_down(PINT_ bn, context);
-        }
-        BN_EXCEPT(PINT_ BN_EXCEPTION_INVALID_OPERATION, "Unknown rounding attempted");
-    }
-    return;
-}
-
-/*
-
-=item C<int
-BN_round_up(PINTD_ BIGNUM *bn, BN_CONTEXT* context)>
-
-Truncates coefficient of C<bn> to have C<precision> digits, then adds
-1 to the last digits and carries until done.  Do not call this
-function with non-positive values of C<precision>.
-
-=cut
-
-*/
-
-int
-BN_round_up(PINTD_ BIGNUM *bn, BN_CONTEXT* context)
-{
-    INTVAL i, carry;
-
-    /* Do a cheap num += 1E+(num->expn) */
-    carry = 1;
-    for (i = bn->digits - context->precision; i< bn->digits; i++) {
-        carry += BN_getd(bn, i);
-        BN_setd(bn, i-bn->digits + context->precision, carry%10);
-        carry = carry / 10;
-    }
-    if (carry) { /* We had 999999999 + 1, extend number */
-        INTVAL extra = bn->digits - context->precision;
-        BN_setd(bn, context->precision, carry);
-        if (CHECK_OVERFLOW(bn, extra, context)) {
-            BN_EXCEPT(PINT_ BN_OVERFLOW, "overflow while rounding");
-        }
-        bn->expn += extra;
-        bn->digits = context->precision +1;
-        return BN_iround(PINT_ bn, context);
-    }
-    else {
-        INTVAL extra = bn->digits - context->precision;
-        if (CHECK_OVERFLOW(bn, extra, context)) {
-            BN_EXCEPT(PINT_ BN_OVERFLOW, "overflow while rounding");
-        }
-        bn->expn += extra;
-        bn->digits = context->precision;
-        return;
-    }
-}
-
-/*
-
-=item C<int
-BN_round_down(PINT_ BIGNUM *bn, BN_CONTEXT* context)>
-
-Truncates the coefficient of C<bn> to have C<precision> digits.  Do
-not call this function with non-positive precision.
-
-=cut
-
-*/
-
-int
-BN_round_down(PINT_ BIGNUM *bn, BN_CONTEXT* context)
-{
-    INTVAL i =0;
-    INTVAL extra;
-
-    for (i=0; i<context->precision; i++) {
-        int temp = BN_getd(bn, i+bn->digits - context->precision);
-        BN_setd(bn, i, temp);
-    }
-    extra = bn->digits - context->precision;
-    if (CHECK_OVERFLOW(bn, extra, context)) {
-        BN_EXCEPT(PINT_ BN_OVERFLOW, "overflow while rounding");
-    }
-    bn->expn += extra;
-    bn->digits = context->precision;
-
-    return;
-}
-
-/*
-
-=item C<void
-BN_round_as_integer(PINTD_ BIGNUM *bn, BN_CONTEXT *context)>
-
-C<precision> must be less than one.  This rounds so that C<expn> is at
-least C<precision>.  Name is slightly misleading.
-
-=cut
-
-*/
-
-void
-BN_round_as_integer(PINTD_ BIGNUM *bn, BN_CONTEXT *context)
-{
-    INTVAL i;
-    BN_CONTEXT temp_context;
-
-    if (bn->expn < context->precision) {
-        {
-            /* Are we losing information? */
-            for (i=0;
-                 i< (context->precision - bn->expn) && i<bn->digits;
-                 i++) {
-                if (BN_getd(bn, i) != 0) {
-                    BN_nonfatal(PINT_ context, BN_LOST_DIGITS,
-                                "digits lost while rounding");
-                    break;
-                }
-            }
-        }
-
-        /* We'll cheat by passing a false context to the normal rounding.
-           If "precision" < 1, we add a false zero to front and set p to 1 */
-        temp_context = *context;
-        temp_context.precision = bn->digits + bn->expn - context->precision;
-        if (temp_context.precision < 1) {
-            temp_context.precision = 1;
-            BN_grow(bn, bn->digits + 1);
-            BN_setd(bn, bn->digits, 0);
-            bn->digits++;
-            BN_iround(PINT_ bn, &temp_context);
-        }
-        else {
-            BN_iround(PINT_ bn, &temp_context);
-        }
-        BN_really_zero(PINT_ bn, context->extended);
-
-        /* XXX: if using warning flags on context, | with temp context here */
-    }
-
-    return;
-}
-
-/*
-
-=back
-
-=head2  Arithmetic operations
-
-Operations are performed like this:
-
-=over 4
-
-=item Rounding
-
-Both operands are rounded to have no more than C<< context->precision >>
-digits.
-
-=item Computation
-
-The operation is computed.
-
-=item Rounding of result
-
-The result is then rounded to context->precision digits.
-
-=item Conversion to zero and integerisation
-
-If the result is equal to zero, it is made exactly zero.
-
-Where the length of the coefficient + the exponent of the result is
-less than context->precision, the result is converted into an integer.
-
-=back
-
-The general form for all arithmetic operations is:
-
-    void BN_operation(result, one, two, context)
-
-=cut
-
-*/
-
-
-/*
-
-=over 4
-
-=item C<int
-BN_arith_setup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-               BN_CONTEXT *context, BN_SAVE_PREC* restore)>
-
-Rounds one and two ready for arithmetic operation.
-
-We assume that an operation might extend the digit buffer with zeros on
-either side, but not tamper with the actual digits of the number, we can
-then easily return the number to the correct (but still rounded)
-representation in _cleanup later
-
-If you can promise that you will not modify the representation of one
-and two during your operation, then you may pass C<&restore> as a
-C<NULL> pointer to both setup and cleanup.
-
-If overflow or underflow occurs during rounding, the numbers will be
-modified to the appropriate representation and will not be restorable.
-
-=cut
-
-*/
-
-int
-BN_arith_setup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-               BN_CONTEXT *context, BN_SAVE_PREC* restore)
-{
-    BN_strip_lead_zeros(PINT_ one, context);
-    BN_strip_lead_zeros(PINT_ two, context);
-    BN_iround(PINT_ one, context);
-    BN_iround(PINT_ two, context);
-    if (restore) {
-        restore->one = *one;
-        restore->two = *two;
-    }
-}
-
-/*
-
-=item C<int
-BN_arith_cleanup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-                 BN_CONTEXT *context, BN_SAVE_PREC* restore)>
-
-Rounds C<result>, C<one>, C<two>, checks for zeroness and makes
-integers. Fixes C<one> and C<two> so they don't gain precision by
-mistake.
-
-=cut
-
-*/
-
-int
-BN_arith_cleanup(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-                 BN_CONTEXT *context, BN_SAVE_PREC* restore)
-{
-    INTVAL i;
-    unsigned char traps_save;
-    unsigned char flags_save;
-    if (restore && one->digits != restore->one.digits) {
-        if (one->expn < restore->one.expn) {
-            for (i=0; i<restore->one.digits; i++)
-                BN_setd(one, i, BN_getd(one, i+restore->one.expn - one->expn));
-            one->expn = restore->one.expn;
-        }
-        one->digits = restore->one.digits;
-    }
-    if (restore && two->digits != restore->two.digits) {
-        if (two->expn < restore->two.expn) {
-            for (i=0; i<restore->two.digits; i++)
-                BN_setd(two, i, BN_getd(two, i+restore->two.expn - two->expn));
-            two->expn = restore->two.expn;
-        }
-        two->digits = restore->two.digits;
-    }
-    /* We don't raise lost_digits after an operation, only beforehand,
-       so we mask off the lost_digits handler to stop the error, and
-       also clear any lost_digits flags*/
-    traps_save = context->traps;
-    flags_save = context->flags;
-    context->traps &= ~(unsigned char)BN_F_LOST_DIGITS;
-    BN_iround(PINT_ result, context);
-    context->traps = traps_save;
-    context->flags =  (context->flags & ~(unsigned char)BN_F_LOST_DIGITS)
-                    | (flags_save & BN_F_LOST_DIGITS);
-
-    BN_strip_lead_zeros(PINT_ result, context);
-    BN_really_zero(PINT_ result, context->extended);
-    BN_make_integer(PINT_ result, context);
-}
-
-/*
-
-=item C<int
-BN_align(PINTD_ BIGNUM* one, BIGNUM* two)>
-
-Adds zero digits so that decimal points of each number are at the same
-place.
-
-=cut
-
-*/
-
-int
-BN_align(PINTD_ BIGNUM* one, BIGNUM* two)
-{
-    INTVAL i;
-    INTVAL diff;
-
-    diff = one->expn - two->expn;
-
-    if (diff == 0) {
-        /* The numbers have the same exponent, we merely need to extend
-           the one with a shorter coeff length with zeros */
-        if (one->digits < two->digits) {
-            BIGNUM *temp = one;
-            one = two;
-            two = temp;
-        }
-
-        BN_grow(PINT_ two, one->digits);
-        for (i=two->digits; i<one->digits; i++) {
-            BN_setd(two, i, 0);
-        }
-        two->digits = one->digits;
-    }
-    else {
-        /* We need to pad both numbers to have the same number of digits
-           the number with the most negative exponent only needs leading
-           digits, while the number with the less negative expn may need
-           both front and back padding, depending on its coeff length.
-           Ideally we'll only move any digit once. */
-        INTVAL final;
-        /* force smallest exponent in two */
-        if (diff < 0) {
-            BIGNUM *temp = one;
-            one = two;
-            two = temp;
-            diff = -diff;
-        }
-
-        if (one->digits + diff < two->digits) {
-            final = two->digits;
-        }
-        else {
-            final = one->digits + diff;
-        }
-
-        BN_grow(PINT_ one, final);
-        BN_grow(PINT_ two, final);
-        /* Add zeros to start of two */
-        for (i=two->digits; i<final; i++)
-            BN_setd(two, i, 0);
-
-        /* Add zeros to start of one */
-        for (i=one->digits + diff; i< final; i++)
-            BN_setd(one, i, 0);
-
-        /* Move one into new home */
-        for (i=one->digits-1; i>-1; i--)
-            BN_setd(one, i+diff, BN_getd(one, i));
-
-        /* Set end of one to zeros */
-        for (i=0; i< diff; i++)
-            BN_setd(one, i, 0);
-
-        one->digits = two->digits = final;
-        one->expn = two->expn;
-    }
-
-}
-/*
-
-=item C<void
-BN_add(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context)>
-
-Adds one to two, returning value in result.
-
-=cut
-
-*/
-
-void
-BN_add(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context)
-{
-    BN_SAVE_PREC restore;
-    /* Special values */
-    if (one->digits == 0 || two->digits == 0) {
-        if (am_NAN(one) || am_NAN(two)) {
-            if (am_sNAN(one) || am_sNAN(two)) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "sNAN in add");
-            }
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        /* Otherwise an infinity */
-        if (am_INF(one) && am_INF(two)) {
-            if (one->sign != two->sign) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "addition of +Inf and -Inf");
-                BN_set_qNAN(PINT_ result);
-                return;
-            }
-            else {
-                BN_set_inf(PINT_ result);
-                result->sign = one->sign;
-                return;
-            }
-        }
-        /* So we've only got one infinity... */
-        BN_set_inf(PINT_ result);
-        result->sign = am_INF(one) ? one->sign : two->sign;
-        return;
-    }
-
-    /* Be careful to do 0 + -0 and -0 + 0 correctly */
-    if (BN_is_zero(PINT_ one, context) && BN_is_zero(PINT_ two, context)) {
-        result->digits = 1;
-        result->expn = 0;
-        BN_setd(result, 0, 0);
-        if (one->sign & two->sign) {
-            result->sign = 1;
-        }
-        else if (context->rounding == ROUND_FLOOR && (one->sign ^ two->sign)) {
-            result->sign = 1;
-        }
-        else {
-            result->sign = 0;
-        }
-        return;
-    }
-
-
-    BN_arith_setup(PINT_ result, one, two, context, &restore);
-
-    /* Do we mean add, or do we mean subtract? */
-    if (one->sign && !two->sign) {             /* -a +  b =  (b-a) */
-        BN_isubtract(PINT_ result, two, one, context);
-    }
-    else if (one->sign && two->sign) {         /* -a + -b = -(a+b) */
-        BN_iadd(PINT_ result, one, two, context);
-        result->sign = 1;
-    }
-    else if (two->sign) {                      /*  a + -b =  (a-b) */
-        BN_isubtract(PINT_ result, one, two, context);
-    }
-    else {                                     /*  a +  b =  (a+b) */
-        BN_iadd(PINT_ result, one, two, context);
-    }
-
-    BN_arith_cleanup(PINT_ result, one, two, context, &restore);
-    /* If using round_floor, need to make sure x + -x => -0 */
-    if (context->rounding == ROUND_FLOOR && BN_is_zero(PINT_ result, context)
-        && (one->sign ^ two->sign)) {
-        result->sign = 1;
-    }
-}
-
-/*
-
-=item C<int
-BN_iadd(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context)>
-
-Adds together two aligned big numbers with coefficients of equal
-length.  Returns a result without reference to the signs of its
-arguments.  Cannot cope with special values.
-
-=cut
-
-*/
-
-int
-BN_iadd(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context)
-{
-    INTVAL i;
-    int carry, dig;
-
-    /* Make sure we don't do work we don't need, or add precision where
-       it isn't wanted */
-    if (BN_is_zero(PINT_ one, context)) {
-        BN_copy(PINT_ result, two);
-        result->sign = 0;
-        return;
-    }
-    else if (BN_is_zero(PINT_ two, context)) {
-        BN_copy(PINT_ result, one);
-        result->sign = 0;
-        return;
-    }
-
-    /* Do the numbers overlap (within precision (and a bit) digits)?
-       If not, we can simply use the first and round given the second
-       by concatenating `01' to the result... Remember that we also know
-       that neither is zero */
-
-    if (context->precision > -1 &&
-        one->expn > two->expn + context->precision +1) {
-        BN_grow(PINT_ result, context->precision + 1);
-        for (i = 0; i < one->digits && i < context->precision; i++) {
-            dig = BN_getd(one, one->digits - i -1);
-            BN_setd(result, context->precision-i, dig);
-        }
-        for (i = i; i < context->precision; i++) {
-            BN_setd(result, context->precision - i, 0);
-        }
-        BN_setd(result, 0, 1);
-        result->digits = context->precision + 1;
-        result->sign = 0;
-        result->expn = one->expn + one->digits - context->precision - 1;
-        return 0;
-    } /* or two might be in the lead, but will he win by more than a length? */
-    else if (context->precision > -1 &&
-             two->expn > one->expn + context->precision + 1) {
-        BN_grow(PINT_ result, context->precision + 1);
-        for (i = 0; i < two->digits && i < context->precision; i++) {
-            dig = BN_getd(two, two->digits -i-1);
-            BN_setd(result, context->precision-i, dig);
-        }
-        for (i = i; i < context->precision; i++) {
-            BN_setd(result, context->precision - i, 0);
-        }
-        BN_setd(result, 0, 1);
-        result->digits = context->precision + 1;
-        result->sign = 0;
-        result->expn = two->expn + two->digits - context->precision - 1;
-        return 0;
-    }
-
-    /* Ok, we can't be lazy, we'll have to do it all ourselves */
-    BN_align(PINT_ one, two);
-
-    BN_grow(PINT_ result, one->digits + 1);
-
-    carry = 0;
-    for (i=0; i< one->digits; i++) {
-        carry += BN_getd(one, i) + BN_getd(two, i);
-        dig = carry % 10;
-        BN_setd(result, i, dig);
-        carry = carry / 10;
-    }
-    if (carry) {
-        BN_setd(result, i, carry);
-        result->digits = i+1;
-    }
-    else {
-        result->digits = i;
-    }
-    result->sign = 0;
-    result->expn = one->expn;
-    return 0;
-}
-
-/*
-
-=item C<void
-BN_subtract(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-            BN_CONTEXT *context)>
-
-Subtracts C<*two> from C<*one>, returning value in C<*result>.
-
-=cut
-
-*/
-
-void
-BN_subtract(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-            BN_CONTEXT *context)
-{
-    BN_SAVE_PREC restore;
-    /* Special values, like addition but careful with those signs eugene */
-    if (one->digits == 0 || two->digits == 0) {
-        if (am_NAN(one) || am_NAN(two)) {
-            if (am_sNAN(one) || am_sNAN(two)) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "sNAN in subtract");
-            }
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        /* Otherwise an infinity */
-        if (am_INF(one) && am_INF(two)) {
-            if (one->sign == two->sign) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "subtraction of Inf and Inf");
-                BN_set_qNAN(PINT_ result);
-                return;
-            }
-            else {
-                BN_set_inf(PINT_ result);
-                result->sign = one->sign;
-                return;
-            }
-        }
-        /* So we've only got one infinity... */
-        BN_set_inf(PINT_ result);
-        result->sign = am_INF(one) ? one->sign : (1 & (1 ^ two->sign));
-        return;
-    }
-
-    /* Be careful to do 0 + -0 and -0 + 0 correctly*/
-    if (BN_is_zero(PINT_ one, context) && BN_is_zero(PINT_ two, context)) {
-        result->digits = 1;
-        result->expn = 0;
-        BN_setd(result, 0, 0);
-        if (one->sign && !two->sign && context->extended) {
-            result->sign = 1;
-        }
-        else if (context->rounding == ROUND_FLOOR &&
-                 (one->sign == two->sign) &&
-                 context->extended) {
-            result->sign = 1;
-        }
-        else {
-            result->sign = 0;
-        }
-        return;
-    }
-
-    BN_arith_setup(PINT_ result, one, two, context, &restore);
-
-    /* Do we mean subtract, or do we mean add? */
-    if (one->sign && !two->sign) {         /* -a -  b = -(a+b) */
-        BN_iadd(PINT_ result, one, two, context);
-        result->sign = 1;
-    }
-    else if (one->sign && two->sign) {     /* -a - -b = (b-a)  */
-        BN_isubtract(PINT_ result, two, one, context);
-    }
-    else if (two->sign) {                  /*  a - -b = (a+b)  */
-        BN_iadd(PINT_ result, one, two, context);
-    }
-    else {                                 /*  a -  b = (a-b)  */
-        BN_isubtract(PINT_ result, one, two, context);
-    }
-
-    BN_arith_cleanup(PINT_ result, one, two, context, &restore);
-    /* If using round_floor, need to make sure x + -x => -0 */
-    if (context->rounding == ROUND_FLOOR && BN_is_zero(PINT_ result, context)
-        && (one->sign == two->sign)) {
-        result->sign = 1;
-    }
-}
-
-/*
-
-=item C<int
-BN_isubtract(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context)>
-
-Subtracts two from one, assumes both numbers have positive aligned
-coefficients of equal length.  Sets sign of result as appropriate.
-Cannot cope with special values.
-
-=cut
-
-*/
-
-int
-BN_isubtract(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context)
-{
-    INTVAL i;
-    int carry, dig;
-    /* Make sure we don't do work we don't need, or add precision where
-       it isn't wanted */
-    if (BN_is_zero(PINT_ one, context)) {
-        BN_copy(PINT_ result, two);
-        result->sign = 1;
-        return;
-    }
-    else if (BN_is_zero(PINT_ two, context)) {
-        BN_copy(PINT_ result, one);
-        result->sign = 0;
-        return;
-    }
-
-    /* Do the numbers fail to overlap?  If so, we can simplify the sum
-       by taking a little bit, but essentially copying... We don't
-       yet know which number is the bigger of the two, so need to do
-       each by itself */
-    if (context->precision > -1 &&
-        one->expn > two->expn + context->precision + 1) {
-        BN_grow(PINT_ result, context->precision + 1);
-        carry = -1;
-        for (i=0; i<one->digits; i++) {
-            carry = carry + BN_getd(one, i);
-            if (carry < 0) {
-                BN_setd(result, context->precision - one->digits + i + 1,
-                        10+carry);
-                carry = -1;
-            }
-            else {
-                BN_setd(result, context->precision - one->digits + i + 1,
-                        carry);
-                carry = 0;
-            }
-        }
-        for (i=0; i<context->precision + 1 - one->digits; i++) {
-            BN_setd(result, i, 9);
-        }
-        result->expn = one->expn + one->digits - context->precision -1;
-        result->sign = 0;
-        result->digits = context->precision + 1;
-        return 1;
-    } /* or, do we do [ickle] - b */
-    else if (context->precision > -1 &&
-             two->expn > one->expn + context->precision + 1) {
-        BN_grow(PINT_ result, context->precision + 1);
-        carry = -1;
-        for (i=0; i<two->digits; i++) {
-            carry = carry + BN_getd(two, i);
-            if (carry < 0) {
-                BN_setd(result, context->precision - two->digits + i + 1,
-                        10+carry);
-                carry = -1;
-            }
-            else {
-                BN_setd(result, context->precision - two->digits + i + 1,
-                        carry);
-                carry = 0;
-            }
-        }
-        for (i=0; i<context->precision + 1 - two->digits; i++) {
-            BN_setd(result, i, 9);
-        }
-        result->expn = two->expn + two->digits - context->precision -1;
-        result->sign = 1;
-        result->digits = context->precision + 1;
-        return 1;
-    }
-
-
-    BN_align(PINT_ one, two);
-
-    /* as a-b == -(b-a), we find larger of
-       a and b and make sure it is in one */
-    carry = 0;
-    for (i=one->digits -1; i>-1; i--) {
-        carry = BN_getd(one, i) - BN_getd(two, i);
-        if (carry) break;
-    }
-
-    if (!carry) { /* a==b*/
-        result->digits = 1;
-        result->sign = 0;
-        BN_setd(result, 0, 0);
-        return;
-    }
-    else if (carry < 0) { /* b > a */
-        BN_isubtract(PINT_ result, two, one, context);
-        result->sign = 1;
-    }
-    else {
-        BN_grow(PINT_ result, one->digits + 1);
-
-        carry = 0;
-        for (i=0; i<one->digits; i++) {
-            carry = carry + BN_getd(one, i) - BN_getd(two, i);
-            if (carry < 0) {
-                BN_setd(result, i, 10+carry);
-                carry = -1;
-            }
-            else {
-                BN_setd(result, i, carry);
-                carry = 0;
-            }
-        }
-
-        PARROT_ASSERT(!carry); /* as to get here a > b*/
-
-        result->digits = one->digits;
-        result->expn = one->expn;
-        result->sign = 0;
-    }
-
-}
-
-/*
-
-=item C<void
-BN_plus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context)>
-
-Perform unary C<+> on C<*one>.  Does all the rounding and what have you.
-
-=cut
-
-*/
-
-void
-BN_plus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context)
-{
-    /* Check for special values */
-    if (one->digits ==0) {
-        if (am_sNAN(one)) BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                                      "sNAN in plus");
-        if (am_NAN(one)) {
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        else { /* Infinity */
-            BN_set_inf(PINT_ result);
-            result->sign = one->sign;
-            return;
-        }
-    }
-
-    BN_arith_setup(PINT_ result, one, one, context, NULL);
-    BN_copy(PINT_ result, one);
-    BN_really_zero(PINT_ result, 0);
-    BN_arith_cleanup(PINT_ result, one, one, context, NULL);
-}
-
-/*
-
-=item C<void
-BN_minus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context)>
-
-Perform unary C<-> (minus) on C<*one>.  Does all the rounding and what
-have you.
-
-=cut
-
-*/
-
-void
-BN_minus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context)
-{
-    /* Check for special values */
-    if (one->digits ==0) {
-        if (am_sNAN(one)) BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                                      "sNAN in minus");
-        if (am_NAN(one)) {
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        else { /* Infinity */
-            BN_set_inf(PINT_ result);
-            result->sign = 1 & (1 ^ one->sign);
-            return;
-        }
-    }
-
-    BN_arith_setup(PINT_ result, one, one, context, NULL);
-    BN_copy(PINT_ result, one);
-    result->sign = result->sign ? 0 : 1;
-    BN_really_zero(PINT_ result, 0);
-    BN_arith_cleanup(PINT_ result, one, one, context, NULL);
-}
-
-/*
-
-=item C<void
-BN_compare(PINT_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-            BN_CONTEXT *context)>
-
-Numerically compares C<*one> and C<*two>, storing the result (as a
-BIGNUM) in C<*result>.
-
-    result = 1  => one > two
-    result = -1 => two > one
-    result = 0  => one == two
-
-=cut
-
-*/
-
-void
-BN_compare(PINT_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-            BN_CONTEXT *context)
-{
-    INTVAL cmp;
-
-    /* Special values */
-    if (one->digits == 0 || two->digits ==0) {
-        /* NaN */
-        if (am_NAN(one) || am_NAN(two)) {
-            if (am_sNAN(one) || am_sNAN(two)) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "NaN in compare");
-            }
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        /* Otherwise at least one of the operands is an infinity */
-        if (one->sign != two->sign) {
-            cmp = one->sign ? -1 : 1;
-        }
-        else if (am_INF(one) && am_INF(two)) {
-            cmp = 0;
-        }
-        else if (am_INF(one)) {
-            cmp = one->sign ? -1 : 1;
-        }
-        else {
-            cmp = one->sign ? 1 : -1;
-        }
-    }
-    else {
-        BN_arith_setup(PINT_ result, one, two, context, NULL);
-        cmp = BN_comp(PINT_ one, two, context);
-    }
-    result->digits = 1;
-    result->expn = 0;
-
-    if (cmp == 0) {
-        BN_setd(result, 0, 0);
-        result->sign = 0;
-    }
-    else if (cmp > 0) {
-        BN_setd(result, 0, 1);
-        result->sign = 0;
-    }
-    else {
-        BN_setd(result, 0, 1);
-        result->sign = 1;
-    }
-    BN_arith_cleanup(PINT_ result, one, two, context, NULL);
-}
-
-/*
-
-=item C<void
-BN_multiply(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-             BN_CONTEXT *context)>
-
-Multiplies C<*one> and C<*two>, storing the result in C<*result>.
-
-=cut
-
-*/
-
-void
-BN_multiply(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-             BN_CONTEXT *context)
-{
-    if (one->digits == 0 || two->digits == 0) {
-        if (am_NAN(one) || am_NAN(two)) {
-            if (am_sNAN(one) || am_sNAN(two)) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "sNAN in multiply");
-            }
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        /* We've got at least one infinity */
-        /* 0 * Inf => NaN */
-        if (BN_is_zero(PINT_ one, context) || BN_is_zero(PINT_ two, context)) {
-            BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                        "Attempt to multiply 0 and Infinity");
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-
-        /* (anything but 0) * Inf => Inf */
-        BN_set_inf(PINT_ result);
-        result->sign = 1 & (one->sign ^ two->sign);
-        return;
-    }
-
-    BN_arith_setup(PINT_ result, one, two, context, NULL);
-
-    BN_imultiply(PINT_ result, one, two, context);
-
-    BN_strip_lead_zeros(PINT_ result, context);
-    BN_arith_cleanup(PINT_ result, one, two, context, NULL);
-
-}
-
-/*
-
-=item C<int
-BN_imultiply(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context)>
-
-Multiplication without the rounding and other set up.
-
-=cut
-
-*/
-
-int
-BN_imultiply(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context)
-{
-    INTVAL i, j;
-    int carry, dig;
-
-    BN_grow(PINT_ result, one->digits + two->digits + 2);
-    /* zero contents of result so that it can be used as intermediate */
-    for (i=0; i<one->digits + two->digits +2; i++)
-        BN_setd(result, i, 0);
-
-    /* make sure largest coeff is in one */
-    if (one->digits < two->digits) {
-        BIGNUM* temp = one;
-        one = two;
-        two = temp;
-    }
-
-    /* multiply element by element */
-    for (i=0; i<two->digits; i++) {
-        dig = BN_getd(two, i);
-        carry = 0;
-        for (j=0; j<one->digits; j++) {
-            carry += BN_getd(one, j) * dig + BN_getd(result, i+j);
-            BN_setd(result, i+j, carry % 10);
-            carry = carry / 10;
-        }
-        if (carry) {
-            BN_setd(result, i+j, carry);
-        }
-    }
-
-    /* extend if there's still stuff to take care of */
-    if (carry) {
-        result->digits = one->digits + two->digits + 1;
-    }
-    else if (BN_getd(result, one->digits + two->digits - 1)) {
-        result->digits = one->digits + two->digits;
-    }
-    else {
-        result->digits = one->digits + two->digits - 1;
-    }
-
-    i = one->expn + two->expn;
-    /*XXX: use unsigned here to be sure? */
-    if (i > context->elimit) {
-        BN_EXCEPT(PINT_ BN_OVERFLOW, "overflow in multiplication");
-    }
-    if (i < -context->elimit) {
-        BN_EXCEPT(PINT_ BN_UNDERFLOW, "underflow in multiplication");
-    }
-    result->expn = i;
-
-    result->sign = 1 & (one->sign ^ two->sign);
-    return;
-}
-
-/*
-
-=item C<void
-BN_divide(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-          BN_CONTEXT *context)>
-
-Divide two into one, storing up to C<precision> digits in result.
-Performs own rounding.  We also assume that this function B<will not
-be used> to produce a BigInt.  That is the job of C<divide_integer()>.
-
-If you want to divide two integers to produce a float, you must do so
-with C<precision> greater than the number of significant digits in
-either operand.  If you want the result to be an integer or a numer
-with a fixed fractional part
-
-=cut
-
-*/
-
-
-void
-BN_divide(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-          BN_CONTEXT *context)
-{
-    BIGNUM* rem;
-    /* Check for special values */
-    if (one->digits == 0 || two->digits == 0) {
-        if (am_NAN(one) || am_NAN(two)) {
-            if (am_sNAN(one) || am_sNAN(two)) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "sNAN in divide");
-            }
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        if (am_INF(one) && am_INF(two)) {
-            BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                        "Inf / Inf in divide");
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        if (am_INF(one)) {
-            if (BN_is_zero(PINT_ two, context)) {
-                BN_nonfatal(PINT_ context, BN_DIVISION_BY_ZERO,
-                            "Inf / 0 in divide");
-            }
-            BN_set_inf(PINT_ result);
-            result->sign = 1 & (one->sign ^ two->sign);
-            return;
-        }
-        /* so we're left with x / Inf */
-        result->digits = 1;
-        result->expn = 0;
-        BN_setd(result, 0, 0);
-        result->sign = 1 & (one->sign ^ two->sign);
-        return;
-    }
-
-    if (BN_is_zero(PINT_ two, context)) {
-        if (BN_is_zero(PINT_ one, context)) {
-            BN_nonfatal(PINT_ context, BN_DIVISION_UNDEFINED,
-                        " 0 / 0 in divide");
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-
-        BN_nonfatal(PINT_ context, BN_DIVISION_BY_ZERO,
-                    "division by zero in divide");
-        BN_set_inf(PINT_ result);
-        result->sign = 1 & (one->sign ^ two->sign);
-        return;
-    }
-
-    /* We're left with the case that only arg 1 is zero */
-    if (BN_is_zero(PINT_ one, context)) {
-        result->expn = 0;
-        result->digits = 1;
-        BN_setd(result, 0, 0);
-        result->sign = 1 & (one->sign ^ two->sign);
-        return;
-    }
-
-    rem = BN_new(PINT_ 1);
-    BN_arith_setup(PINT_ result, one, two, context, NULL);
-    BN_idivide(PINT_ result, one, two, context, BN_DIV_DIVIDE, rem);
-
-    /* Use rem to work out things like rounding here, we'll do our
-       own clean up as it's all a little odd */
-
-    BN_strip_lead_zeros(PINT_ result, context);
-
-    /*XXX: write this rounding to cope with precision < 1 */
-    if (context->rounding == ROUND_HALF_EVEN) {
-        if (result->digits > context->precision) {
-            BN_nonfatal(PINT_ context, BN_ROUNDED, "Rounded in divide");
-            /* We collected precision + 1 digits... */
-            BN_really_zero(PINT_ rem, context->extended);
-            if (BN_getd(result, 0) > 5) {
-                BN_nonfatal(PINT_ context, BN_INEXACT,
-                            "Loss of precision in divide");
-                BN_round_up(PINT_ result, context);
-            }
-            else if (BN_getd(result, 0) == 5) {
-                BN_nonfatal(PINT_ context, BN_INEXACT,
-                            "Loss of precision in divide");
-                if (rem->digits == 1 && BN_getd(rem, 0)==0) {
-                    switch (BN_getd(result, 1)) {
-                    case 2:
-                    case 4:
-                    case 6:
-                    case 8:
-                    case 0:
-                        BN_round_down(PINT_ result, context);
-                        break;
-                    default :
-                        BN_round_up(PINT_ result, context);
-                    }
-                }
-                else {
-                    BN_nonfatal(PINT_ context, BN_INEXACT,
-                                "Loss of precision in divide");
-                    BN_round_up(PINT_ result, context);
-                }
-            }
-            else {
-                if (BN_getd(result, 0) !=0) {
-                    BN_nonfatal(PINT_ context, BN_INEXACT,
-                                "Loss of precision in divide");
-                }
-                else if (!BN_is_zero(PINT_ result, context)) {
-                    BN_nonfatal(PINT_ context, BN_INEXACT,
-                                "Loss of precision in divide");
-                }
-                BN_round_down(PINT_ result, context);
-            }
-        }
-    }
-    else if (context->rounding == ROUND_CEILING) {
-        if (result->digits > context->precision) {
-            BN_nonfatal(PINT_ context, BN_ROUNDED,
-                        "Rounded in divide");
-            BN_really_zero(PINT_ rem, context->extended);
-
-            if (result->sign) {
-                if (BN_getd(result, 0) != 0 ||
-                    !BN_is_zero(PINT_ result, context)) {
-                    BN_nonfatal(PINT_ context, BN_INEXACT,
-                                "Loss of precision in divide");
-                }
-                BN_round_down(PINT_ result, context);
-            }
-            else if (BN_getd(result, 0) != 0) {
-                BN_nonfatal(PINT_ context, BN_INEXACT,
-                            "Loss of precision in divide");
-                BN_round_up(PINT_ result, context);
-            }
-            else if (!BN_is_zero(PINT_ rem, context)) {
-                BN_nonfatal(PINT_ context, BN_INEXACT,
-                            "Loss of precision in divide");
-                BN_round_up(PINT_ result, context);
-            }
-            else {
-                BN_round_down(PINT_ result, context);
-            }
-        }
-    }
-    else if (context->rounding == ROUND_FLOOR) {
-        if (result->digits > context->precision) {
-            BN_nonfatal(PINT_ context, BN_ROUNDED,
-                        "Rounded in divide");
-            BN_really_zero(PINT_ rem, context->extended);
-
-            if (!result->sign) {
-                if (BN_getd(result, 0) != 0 ||
-                    !BN_is_zero(PINT_ result, context)) {
-                    BN_nonfatal(PINT_ context, BN_INEXACT,
-                                "Loss of precision in divide");
-                }
-                BN_round_down(PINT_ result, context);
-            }
-            else if (BN_getd(result, 0) != 0) {
-                BN_nonfatal(PINT_ context, BN_INEXACT,
-                            "Loss of precision in divide");
-                BN_round_up(PINT_ result, context);
-            }
-            else if (!BN_is_zero(PINT_ rem, context)) {
-                BN_nonfatal(PINT_ context, BN_INEXACT,
-                            "Loss of precision in divide");
-                BN_round_up(PINT_ result, context);
-            }
-            else {
-                BN_round_down(PINT_ result, context);
-            }
-        }
-    }
-    else { /* Other roundings just need digits to play with */
-        unsigned char save_lost;
-        unsigned char flags_save;
-        /* We don't warn on lost digits here, as is after an operation */
-        save_lost = context->traps;
-        context->traps &= ~(unsigned char)BN_F_LOST_DIGITS;
-        flags_save = context->flags;
-        BN_iround(PINT_ result, context);
-
-        /* We need to check the remainder here, as we might have
-           passed "[digits we want]0[digits we've kept a secret]" into
-           the rounding without knowing it*/
-        if (!BN_is_zero(PINT_ rem, context)) {
-            BN_nonfatal(PINT_ context, BN_INEXACT,
-                        "Loss of precision in divide");
-        }
-
-        context->traps = save_lost;
-        context->flags =  (context->flags & ~(unsigned char)BN_F_LOST_DIGITS)
-            | (flags_save & BN_F_LOST_DIGITS);
-    }
-
-    BN_really_zero(PINT_ result, context->extended);
-
-    BN_strip_tail_zeros(PINT_ result, context);
-
-    BN_make_integer(PINT_ result, context);
-
-    /* Remove trailing zeros if positive exponent */
-    if (result->expn > 0) {
-        INTVAL i, j;
-        for (i=0; i<result->digits; i++) {
-            if (BN_getd(result, i) != 0) break;
-        }
-        if (i) {
-            for (j=i; j<result->digits; j++) {
-                BN_setd(result, j-i, BN_getd(result, j));
-            }
-        }
-        if (CHECK_OVERFLOW(result, i, context)) {
-            BN_EXCEPT(PINT_ BN_OVERFLOW, "overflow in divide");
-        }
-        result->expn += i;
-    }
-
-    BN_destroy(PINT_ rem);
-}
-
-/*
-
-=item C<void
-BN_divide_integer(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-                   BN_CONTEXT *context)>
-
-Places the integer part of C<*one> divided by C<*two> into C<*result>.
-
-=cut
-
-*/
-
-void
-BN_divide_integer(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-                   BN_CONTEXT *context)
-{
-    BIGNUM* rem;
-    /* Check for special values (same as divide...) */
-    if (one->digits == 0 || two->digits == 0) {
-        if (am_NAN(one) || am_NAN(two)) {
-            if (am_sNAN(one) || am_sNAN(two)) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "sNAN in divide-integer");
-            }
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        if (am_INF(one) && am_INF(two)) {
-            BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                        "Inf / Inf in divide-integer");
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        if (am_INF(one)) {
-            if (BN_is_zero(PINT_ two, context)) {
-                BN_nonfatal(PINT_ context, BN_DIVISION_BY_ZERO,
-                            "Inf / 0 in divide-integer");
-            }
-            BN_set_inf(PINT_ result);
-            result->sign = 1 & (one->sign ^ two->sign);
-            return;
-        }
-        /* so we're left with x / Inf */
-        result->digits = 1;
-        result->expn = 0;
-        BN_setd(result, 0, 0);
-        result->sign = 1 & (one->sign ^ two->sign);
-        return;
-    }
-
-    if (BN_is_zero(PINT_ two, context)) {
-        if (BN_is_zero(PINT_ one, context)) {
-            BN_nonfatal(PINT_ context, BN_DIVISION_UNDEFINED,
-                        " 0 / 0 in divide-integer");
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-
-        BN_nonfatal(PINT_ context, BN_DIVISION_BY_ZERO,
-                    "division by zero in divide-integer");
-        BN_set_inf(PINT_ result);
-        result->sign = 1 & (one->sign ^ two->sign);
-        return;
-    }
-
-    /* We're left with the case that only arg 1 is zero */
-    if (BN_is_zero(PINT_ one, context)) {
-        result->expn = 0;
-        result->digits = 1;
-        BN_setd(result, 0, 0);
-        result->sign = 1 & (one->sign ^ two->sign);
-        return;
-    }
-
-    rem = BN_new(PINT_ 1);
-    BN_arith_setup(PINT_ result, one, two, context, NULL);
-    BN_idivide(PINT_ result, one, two, context, BN_DIV_DIVINT, rem);
-
-    BN_really_zero(PINT_ rem, context->extended);
-    if (result->expn >0 && context->precision > 0 &&
-        result->expn + result->digits > context->precision &&
-        !(rem->digits == 0 && BN_getd(rem, 0) == 0)) {
-        BN_nonfatal(PINT_ context, BN_DIVISION_IMPOSSIBLE,
-                  "divide-integer requires more precision than available");
-        BN_set_qNAN(PINT_ result);
-        BN_destroy(PINT_ rem);
-        return;
-    }
-    BN_destroy(PINT_ rem);
-    if (result->expn != 0) {
-        INTVAL i;
-        BN_grow(PINT_ result, result->expn + result->digits);
-        for (i=0; i<result->digits; i++) {
-            BN_setd(result, result->expn + result->digits -1 -i,
-                    BN_getd(result, result->digits - 1- i));
-        }
-        for (i=0; i<result->expn; i++) {
-            BN_setd(result, i, 0);
-        }
-        result->digits += result->expn;
-        result->expn = 0;
-    }
-
-    BN_really_zero(PINT_ result, context->extended);
-    BN_make_integer(PINT_ result, context);
-}
-
-/*
-
-=item C<void
-BN_remainder(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context)>
-
-Places the remainder from divide-integer (above) into C<*result>.
-
-=cut
-
-*/
-
-void
-BN_remainder(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two,
-              BN_CONTEXT *context)
-{
-    BIGNUM* fake;
-
-    /* Check for special values */
-    if (one->digits == 0 || two->digits == 0) {
-        if (am_NAN(one) || am_NAN(two)) {
-            if (am_sNAN(one) || am_sNAN(two)) {
-                BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                            "sNAN in remainder");
-            }
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        /* Infinities, first cover Inf rem x and Inf rem Inf */
-        if (am_INF(one)) {
-            BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                        "x rem Inf in remainder");
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        /* now cover x rem Inf => 0 */
-        result->expn = 0;
-        result->digits = 1;
-        BN_setd(result, 0, 0);
-        result->sign = one->sign;
-        return;
-    }
-
-    if (BN_is_zero(PINT_ two, context)) {
-        if (BN_is_zero(PINT_ one, context)) {
-            BN_nonfatal(PINT_ context, BN_DIVISION_UNDEFINED,
-                        "0 rem 0 in remainder");
-            BN_set_qNAN(PINT_ result);
-            return;
-        }
-        BN_nonfatal(PINT_ context, BN_EXCEPTION_INVALID_OPERATION,
-                    "x rem 0 in remainder");
-        BN_set_qNAN(PINT_ result);
-        return;
-    }
-
-    if (BN_is_zero(PINT_ one, context)) {
-        result->digits = 1;
-        result->sign = 0;
-        BN_setd(result, 0, 0);
-        return;
-    }
-
-    BN_arith_setup(PINT_ result, one, two, context, NULL);
-    fake = BN_new(1);
-    BN_idivide(PINT_ fake, one, two, context, BN_DIV_REMAIN, result);
-
-    BN_really_zero(PINT_ result, context->extended);
-    if (fake->expn >0 && context->precision > 0 &&
-        fake->expn + result->digits > context->precision &&
-        !(result->digits == 0 && BN_getd(result, 0) == 0)) {
-        BN_nonfatal(PINT_ context, BN_DIVISION_IMPOSSIBLE,
-                    "remainder requires more precision than available");
-        BN_set_qNAN(PINT_ result);
-        BN_destroy(PINT_ fake);
-        return;
-    }
-
-
-    BN_destroy(PINT_ fake);
-
-    result->sign = one->sign;
-
-    BN_arith_cleanup(PINT_ result, one, two, context, NULL);
-}
-
-/*
-
-=item C<int BN_idivide(PINT_ BIGNUM *result, BIGNUM *one, BIGNUM *two,
-            BN_CONTEXT *context, BN_DIV_ENUM operation, BIGNUM *rem)>
-
-Does the heavy work for the various division wossnames.
-
-=cut
-
-*/
-int
-BN_idivide(PINT_ BIGNUM *result, BIGNUM *one, BIGNUM *two,
-            BN_CONTEXT *context, BN_DIV_ENUM operation, BIGNUM *rem)
-{
-    INTVAL i, j, divided, newexpn;
-    BIGNUM *div, *t1, *t2;
-    int s2, value;
-
-    /* We assume we've been given something to divide */
-
-    /* Make some temporaries, set all signs to positive for simplicity */
-    /* We use result as a temporary and store the reversed result in t2 */
-    div = BN_new(PINT_ 1);
-    BN_copy(PINT_ div, one);
-    BN_copy(PINT_ rem, div); /* In case doing int-div and don't div*/
-    div->sign = 0;
-    t1 = BN_new(PINT_ 1);
-    t2 = BN_new(PINT_ 1);
-    t2->digits = 0; /* ok, as all internal */
-    s2 = two->sign; /* store the sign of 2, as we set it +ve internally */
-    two->sign = 0;
-    result->digits = 1;
-    rem->digits = 1;
-
-    /* First position to try to fill */
-    newexpn = one->digits + one->expn - two->digits - two->expn;
-    if (newexpn > context->elimit) {
-        BN_EXCEPT(PINT_ BN_OVERFLOW, "overflow in divide (1)");
-    }
-    if (newexpn < -context->elimit) {
-        BN_EXCEPT(PINT_ BN_UNDERFLOW, "underflow in divide (1)");
-    }
-    t1->expn = newexpn;
-
-    value = 0;
-    for (;;) {
-        if (!(t2->digits % 10)) BN_grow(PINT_ t2, t2->digits+11);
-        if ((operation == BN_DIV_DIVINT || operation == BN_DIV_REMAIN) &&
-            t1->expn < 0) break;
-        divided = 0;
-        for (j=1; j<=10;j++) {
-            int cmp;
-            BN_setd(t1, 0, j);
-            BN_imultiply(PINT_ result, t1, two, context);
-            cmp = BN_comp(PINT_ result, div, context);
-            if (cmp ==0) {
-                BN_setd(t2, value, j);
-                t2->digits++;
-                value++;
-                j = j+1; /* for multiply below */
-                divided = 1;
-                break;
-            }
-            else if (cmp> 0) {
-                if (j==1 && value == 0) break; /* don't collect leading 0s */
-                BN_setd(t2, value, j-1);
-                t2->digits++;
-                value++;
-                divided = 1;
-                break;
-            }
-        }
-        if (divided) {
-            BN_setd(t1, 0, j-1);
-            BN_imultiply(PINT_ result, t1, two, context);
-            BN_isubtract(PINT_ rem, div, result, context);
-        }
-
-        /* Are we done yet? */
-        if (value && rem->digits ==1 && BN_getd(rem, 0)==0) {
-            break;
-        }
-
-        /* We collect one more digit than precision requires, then
-           round in divide, if we're doing divint or rem then we terminate
-           at the decimal point and return */
-        if (context->precision > 0) {
-            if (t2->digits == context->precision + 1) {
-                break;
-            }
-        }
-        else {
-            if (t1->expn == context->precision -1) break;
-        }
-        if (operation == BN_DIV_DIVINT|| operation == BN_DIV_REMAIN) {
-            if (t1->expn ==0) break;
-        }
-        if (CHECK_UNDERFLOW(t1, 1, context)) {
-            BN_EXCEPT(PINT_ BN_UNDERFLOW, "underflow in divide (2)");
-        }
-        t1->expn--;
-        if (divided) BN_copy(PINT_ div, rem);
-    }
-
-    /* Work out the sign and exponent of the result */
-    for (i=0; i< t2->digits; i++) {
-        BN_setd(result, i, BN_getd(t2, t2->digits - 1 -i));
-    }
-    if (t2->digits == 0||(!divided&&!value)) {
-        result->digits = 1;
-        BN_setd(result, 0, 0);
-        result->sign = 0;
-    }
-    else {
-        result->digits = t2->digits;
-        result->sign = 1&(one->sign ^ s2);
-        result->expn = t1->expn; /* We know this is fine, from above */
-    }
-    two->sign = s2;
-    rem->sign = 1&(one->sign ^ s2);
-
-    BN_destroy(PINT_ t1);
-    BN_destroy(PINT_ t2);
-    BN_destroy(PINT_ div);
-
-    return; /* phew! */
-}
-
-/*
-
-=item C<INTVAL
-BN_comp(PINTD_ BIGNUM *one, BIGNUM *two, BN_CONTEXT* context)>
-
-Comparison with no rounding etc.
-
-=cut
-
-*/
-
-INTVAL
-BN_comp(PINTD_ BIGNUM *one, BIGNUM *two, BN_CONTEXT* context)
-{
-    INTVAL i, j;
-    int cmp;
-
-    BN_strip_lead_zeros(PINT_ one, context);
-    BN_strip_lead_zeros(PINT_ two, context);
-
-    if (one->sign != two->sign) {
-        if (BN_is_zero(PINT_ one, context) && BN_is_zero(PINT_ two, context)) {
-            return 0; /* as -0 == 0 */
-        }
-        return one->sign ? -1 : 1;
-    }
-    else if (one->expn + one->digits > two->expn + two->digits) {
-        return one->sign ? -1 : 1;
-    }
-    else if (one->expn + one->digits < two->expn + two->digits) {
-        return one->sign ? 1 : -1;
-    }
-    else { /* Same sign, same "size" */
-        for (i=0; i<one->digits && i<two->digits; i++) {
-            cmp = BN_getd(one, one->digits-1-i)
-                      - BN_getd(two, two->digits-1-i);
-            if (cmp) return one->sign ? -cmp : cmp;
-        }
-        if (!cmp) {
-            if (i==one->digits) {
-                for (i=i; i<two->digits; i++) {
-                    cmp = 0-BN_getd(two, two->digits-1-i);
-                    if (cmp) return one->sign ? -cmp : cmp;
-                }
-            }
-            else if (i==two->digits) {
-                for (i=i; i<one->digits; i++) {
-                    cmp = BN_getd(one, one->digits-1-i);
-                    if (cmp) return one->sign ? -cmp : cmp;
-                }
-            }
-            return one->sign ? -cmp : cmp;
-        }
-    }
-}
-
-/*
-
-=item C<void
-BN_power(PINTD_ BIGNUM* result, BIGNUM* bignum,
-              BIGNUM* expn, BN_CONTEXT* context)>
-
-Calculate C<result> = C<bignum> to the power of C<*expn>;
-
-=cut
-
-*/
-
-void
-BN_power(PINTD_ BIGNUM* result, BIGNUM* bignum,
-              BIGNUM* expn, BN_CONTEXT* context)
-{
-    BN_arith_setup(PINT_ result, bignum, expn, context, NULL);
-    BN_arith_cleanup(PINT_ result, bignum, expn, context, NULL);
-}
-
-/*
-
-=item C<void
-BN_rescale(PINTD_ BIGNUM* result, BIGNUM* one, BIGNUM* two,
-                BN_CONTEXT* context)>
-
-Rescales C<*one> to have an exponent of C<*two>.
-
-=cut
-
-*/
-
-void
-BN_rescale(PINTD_ BIGNUM* result, BIGNUM* one, BIGNUM* two,
-                BN_CONTEXT* context)
-{
-    INTVAL expn;
-    unsigned char lost = context->traps;
-    context->traps &= ~(unsigned char)BN_F_LOST_DIGITS;
-
-    BN_arith_setup(PINT_ result, one, two, context, NULL);
-
-    expn = BN_to_int(PINT_ two, context);
-
-    context->traps = lost;
-
-    BN_arith_cleanup(PINT_ result, one, two, context, NULL);
-}
-
-/*
-
-=item C<INTVAL
-BN_to_int(PINT_ BIGNUM* bn, BN_CONTEXT* context)>
-
-Converts the bignum into an integer, raises overflow if an exact
-representation cannot be created.
-
-=cut
-
-*/
-
-INTVAL
-BN_to_int(PINT_ BIGNUM* bn, BN_CONTEXT* context)
-{
-    INTVAL insig, i;
-    INTVAL result = 0;
-    INTVAL maxdigs = BN_D_PER_INT < context->precision ?
-        BN_D_PER_INT : context->precision;
-    if (context->precision < 0) maxdigs = BN_D_PER_INT;
-
-
-    BN_strip_lead_zeros(PINT_ bn, context);
-    /* Check for definite big as your head overflow */
-    if (bn->expn >= 0 && bn->expn + bn->digits > BN_D_PER_INT) {
-        BN_EXCEPT(PINT_ BN_OVERFLOW, "bignum too large to fit in an int");
-    }
-    if (bn->expn < 0 && bn->expn + bn->digits > BN_D_PER_INT) {
-
-        BN_EXCEPT(PINT_ BN_OVERFLOW, "bignum too large to fit in an int");
-    }
-
-    /* if e>0, if we'll lose precision we'll also be too big, so lose
-       above anyway.  On the other hand, with e<0, we can lose digits <
-       . from this so need to check that we don't lose precision */
-    if (bn->expn<0 && context->traps & BN_F_LOST_DIGITS) {
-        BN_EXCEPT(PINT_ BN_LOST_DIGITS, "digits lost in conv -> int");
-    }
-
-    if (bn->digits + bn->expn > context->precision && context->precision > 0) {
-        BN_EXCEPT(PINT_ BN_LOST_DIGITS, "digits lost in conv -> int");
-    }
-
-    /* luckily, we get to keep our digits, so let's get at 'em */
-    if (bn->expn >= 0) {
-        for (i = bn->digits-1; i>-1; i--) {
-            result = result * 10 + BN_getd(bn, i);
-        }
-        for (i=0; i<bn->expn; i++) result = result * 10;
-    }
-    else {
-        for (i=bn->digits-1; i>-1-bn->expn; i--) {
-            result = result * 10 + BN_getd(bn, i);
-        }
-    }
-
-    return bn->sign ? -result : result;
-}
-
-/*
-
-=item C<INTVAL
-BN_is_zero(BIGNUM* foo, BN_CONTEXT* context)>
-
-Returns a boolean value indicating whether C<*foo> is zero.
-
-=cut
-
-*/
-
-INTVAL
-BN_is_zero(BIGNUM* foo, BN_CONTEXT* context)
-{
-    BN_really_zero(foo, context->extended);
-    if (foo->digits == 1 && foo->expn == 0 && BN_getd(foo, 0) == 0) {
-        return 1;
-    }
-    else {
-        return 0;
-    }
-}
-
-/*
-
-=back
-
-=head1 TODO
-
-This is currently not used yet. Parrot has no BigNum support yet.
-
-Parrot string playing, exception raising
-
-==head1 SEE ALSO
-
-F<docs/docs/pdds/draft/pdd14_bignum.pod>,
-L<https://rt.perl.org/rt3/Ticket/Display.html?id=36330>
-
-=cut
-
-*/
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Deleted: branches/vtable_morph_change/src/bignum.h
==============================================================================
--- branches/vtable_morph_change/src/bignum.h	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,210 +0,0 @@
-/*
-Copyright (C) 2001-2003, The Perl Foundation.
-$Id$
-
-=head1 NAME
-
-src/bignum.h - Infinite precision bcd for parrot
-
-=head1 DESCRIPTION
-
-Some of this file will want to be moved to the parrot include
-directories, but some should stay here, for the sake of being easily
-removed for back-porting.
-
-=head1 TODO
-
-This is currently not used yet. Parrot has no BigNum support yet.
-
-==head1 SEE ALSO
-
-F<docs/docs/pdds/draft/pdd14_bignum.pod>,
-L<https://rt.perl.org/rt3/Ticket/Display.html?id=36330>
-
-=cut
-
-*/
-
-#ifndef PARROT_TYPES_BIGNUM_H_GUARD
-#define PARROT_TYPES_BIGNUM_H_GUARD
-
-/* Stuff to be parrot-like in source, even if not being used in parrot */
-#ifdef PARROT_IN_CORE
-#define PINT_ interpreter,
-#define PINTD_ INTERP* interpreter,
-#define BN_alloc(i, x) malloc(x)
-#define BN_realloc(i, x, y) realloc((x), (y))
-#define BN_free(i, x) free(x)
-#define BN_FATAL(i, x) bn_fatal_error(x)
-#define BN_EXCEPT(i, excp, mesg) BN_exception((i), (excp), (mesg))
-#else /* Not in parrot core */
-#define PINTD_
-#define PINT_
-#define BN_alloc(x) malloc(x)
-#define BN_realloc(x, y) realloc((x), (y))
-#define BN_free(x) free(x)
-#define BN_FATAL(x) bn_fatal_error(x)
-#define BN_EXCEPT(excp, mesg) BN_exception((excp), (mesg))
-typedef unsigned int UINTVAL;
-typedef int INTVAL;
-#endif /* ifdef PARROT_IN_CORE else */
-
-/* Stuff configure should determine*/
-#define BN_D_PER_NIB 8       /* digits stored in a BN_NIB */
-#define BN_D_PER_INT 10      /* Decimal digits in an INTVAL */
-#define BN_D_PER_FLOAT 32    /* Decimal digits in a FLOATVAL */
-#define BN_HARD_EXPN_LIMIT 999999999 /* perhaps max INTVAL? */
-#define BN_EXPN_MAX 10000    /* maximum value of expn*/
-#define BN_EXPN_MIN -10000   /* minimum value of expn */
-#define BN_MAX_DIGITS 10000  /* max number of digits in coeff */
-
-typedef UINTVAL BN_NIB;
-
-/* BIGNUM: 12345678901234xxxxxxxxxx , expn = -5, sign = 1
-           ^       ^        ^
- value = -123456789.01234
-
- buffer points to first caret (here an INTVAL)
- nibs == 3, digits == 14
-*/
-
-typedef struct parrot_bignum_t {
-    BN_NIB* buffer; /* string of nibbles */
-    UINTVAL nibs;   /* nibs allocated, in sizeof(BN_NIB) */
-    UINTVAL flags;  /* private flags store: 001 Inf,  010 qNAN, 110 sNAN */
-    INTVAL digits;  /* digits used */
-    int sign;       /* sign of number, 0=> positive or zero, 1 => negative */
-    INTVAL expn;    /* exponent of number */
-} parrot_bignum_t;
-
-#define BIGNUM parrot_bignum_t
-
-/* CONTEXT: defines the context for the operation, precision and rounding */
-
-typedef enum {
-    ROUND_HALF_UP,
-    ROUND_DOWN,
-    ROUND_HALF_EVEN,
-    ROUND_CEILING,
-    ROUND_FLOOR
-} BN_ROUNDING;
-
-/* Flags for exception triggers and exception signals */
-typedef enum {
-    BN_F_LOST_DIGITS = 1,
-    BN_F_DIVISION_BY_ZERO = 2,
-    BN_F_INEXACT = 4,
-    BN_F_EXCEPTION_INVALID_OPERATION = 8,
-    BN_F_OVERFLOW = 16,
-    BN_F_ROUNDED = 32,
-    BN_F_UNDERFLOW = 64
-} parrot_bignum_context_flags;
-
-typedef struct parrot_bignum_context {
-    INTVAL precision;     /* number of digs to retain */
-    INTVAL elimit;        /* maximum exponent allowed */
-    BN_ROUNDING rounding; /* rounding type to perform */
-    INTVAL extended;     /* do we use extended or base semantics? */
-    unsigned char flags;       /* records possible errors */
-    unsigned char traps;       /* throw errors or not? */
-} parrot_bignum_context;
-
-#define BN_CONTEXT parrot_bignum_context
-
-/* Exceptional Conditions */
-
-typedef enum {
-    BN_CONVERSION_OVERFLOW,
-    /* Asked to hold coeff|expn too large value */
-    BN_CONVERSION_SYNTAX,
-    /* string not conforming to numeric form */
-    BN_CONVERSION_UNDERFLOW,
-    /* expn of string too small to be held  */
-    BN_DIVISION_BY_ZERO,
-    /* dividend of div/div-int or pow zero  */
-    BN_DIVISION_IMPOSSIBLE,
-    /* integer result of div-int or rem > precision */
-    BN_DIVISION_UNDEFINED,
-    /* div by zero with zero on top also */
-    BN_INEXACT,
-    /* some sort of rounding, with loss of information */
-    BN_INSUFFICIENT_STORAGE,
-    /* not enough space to hold intermediate results */
-    BN_INVALID_CONTEXT,
-    /* context given was not valid (unknown round) */
-    BN_EXCEPTION_INVALID_OPERATION,
-    /* operation which is not valid */
-    BN_LOST_DIGITS,
-    /* digits lost in rounding  */
-    BN_OVERFLOW,
-    /* expn becomes larger than max allowed */
-    BN_ROUNDED,
-    /* something was rounded */
-    BN_UNDERFLOW
-    /* expn becomes smaller than min allowed */
-} BN_EXCEPTIONS;
-
-/* Flags for extended values (private flags of buffer struct) */
-typedef enum {
-    BN_INF_FLAG  = 1, /* 001 */
-    BN_qNAN_FLAG = 2, /* 010 (quiet)     */
-    BN_sNAN_FLAG = 4  /* 100 (signaling) */
-} parrot_bignum_extended_flags;
-
-/*Capn' Cut-n-paste functions */
-/* public functions generally return either BIGNUM* if they create a
-   bignumber or void if they merely operate on them, errors are reported
-   through the context->flags and the exception mechanism.
-
-   BN_round returns an int, to make the internals a bit clearer, it
-   doesn't actually carry any meaning.
-*/
-BIGNUM* BN_from_string(PINTD_ char*, BN_CONTEXT*);
-BIGNUM* BN_new(PINTD_ INTVAL length);
-BN_CONTEXT* BN_create_context(PINTD_ INTVAL precision);
-void BN_grow(PINTD_ BIGNUM *in, INTVAL length);
-void BN_destroy(PINTD_ BIGNUM *bn);
-void bn_fatal_error(PINTD_ char* mesg);
-INTVAL BN_set_digit(PINTD_ BIGNUM* bn, INTVAL pos, INTVAL value);
-INTVAL BN_get_digit(PINTD_ BIGNUM* bn, INTVAL pos);
-BIGNUM* BN_copy(PINTD_ BIGNUM*, BIGNUM*);
-BIGNUM* BN_new_from_int(PINTD_ INTVAL value);
-INTVAL BN_to_scientific_string(PINTD_ BIGNUM* bn, char **dest);
-INTVAL BN_to_engineering_string(PINTD_ BIGNUM*bn, char **dest);
-void BN_round(PINTD_ BIGNUM *victim, BN_CONTEXT *context);
-void BN_round_as_integer(PINTD_ BIGNUM *, BN_CONTEXT*);
-void BN_EXCEPT(PINTD_ BN_EXCEPTIONS, char*);
-void BN_add(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context);
-void
-BN_subtract(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context);
-void BN_plus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context);
-void BN_minus(PINTD_ BIGNUM* result, BIGNUM *one, BN_CONTEXT *context);
-void
-BN_compare(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context);
-void
-BN_multiply(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context);
-void
-BN_divide(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context);
-void
-BN_divide_integer(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context);
-void
-BN_remainder(PINTD_ BIGNUM* result, BIGNUM *one, BIGNUM *two, BN_CONTEXT *context);
-void BN_rescale(PINTD_ BIGNUM* result, BIGNUM* bignum, BIGNUM* expn, BN_CONTEXT* context);
-INTVAL BN_to_int(PINTD_ BIGNUM* bignum, BN_CONTEXT* context);
-void BN_power(PINTD_ BIGNUM* result, BIGNUM* bignum,
-              BIGNUM* expn, BN_CONTEXT* context);
-INTVAL BN_comp(PINTD_ BIGNUM *one, BIGNUM *two, BN_CONTEXT*);
-INTVAL BN_is_zero(PINTD_ BIGNUM* test, BN_CONTEXT *);
-int BN_set_qNAN(PINTD_ BIGNUM* bn);
-int BN_set_sNAN(PINTD_ BIGNUM* bn);
-int BN_set_inf(PINTD_ BIGNUM* bn);
-int BN_really_zero(PINTD_ BIGNUM* bn, int);
-
-#endif /* PARROT_TYPES_BIGNUM_H_GUARD */
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/vtable_morph_change/src/debug.c
==============================================================================
--- branches/vtable_morph_change/src/debug.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/debug.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -119,88 +119,6 @@
 static PDB_breakpoint_t * current_breakpoint(ARGIN(PDB_t * pdb))
         __attribute__nonnull__(1);
 
-static void dbg_break(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_continue(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_delete(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_disable(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_disassemble(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_echo(ARGMOD(PDB_t * pdb), SHIM(const char * cmd))
-        __attribute__nonnull__(1)
-        FUNC_MODIFIES(* pdb);
-
-static void dbg_enable(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_eval(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_gcdebug(ARGMOD(PDB_t * pdb), SHIM(const char * cmd))
-        __attribute__nonnull__(1)
-        FUNC_MODIFIES(* pdb);
-
-static void dbg_help(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_info(ARGIN(PDB_t * pdb), SHIM(const char * cmd))
-        __attribute__nonnull__(1);
-
-static void dbg_list(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_load(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_next(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_print(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_quit(ARGMOD(PDB_t * pdb), SHIM(const char * cmd))
-        __attribute__nonnull__(1)
-        FUNC_MODIFIES(* pdb);
-
-static void dbg_run(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_script(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_stack(ARGIN(PDB_t * pdb), SHIM(const char * cmd))
-        __attribute__nonnull__(1);
-
-static void dbg_trace(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
-static void dbg_watch(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
-
 static void debugger_cmdline(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -293,64 +211,6 @@
        PARROT_ASSERT_ARG(cmd)
 #define ASSERT_ARGS_current_breakpoint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(pdb)
-#define ASSERT_ARGS_dbg_break __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_continue __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_delete __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_disable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_disassemble __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_echo __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb)
-#define ASSERT_ARGS_dbg_enable __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_eval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_gcdebug __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb)
-#define ASSERT_ARGS_dbg_help __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_info __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb)
-#define ASSERT_ARGS_dbg_list __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_load __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_next __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_print __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_quit __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb)
-#define ASSERT_ARGS_dbg_run __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_script __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_stack __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb)
-#define ASSERT_ARGS_dbg_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
-#define ASSERT_ARGS_dbg_watch __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(pdb) \
-    || PARROT_ASSERT_ARG(cmd)
 #define ASSERT_ARGS_debugger_cmdline __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_dump_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -394,60 +254,60 @@
  *  Command functions and help dispatch
  */
 
-typedef void (* debugger_func_t)(ARGIN(PDB_t * pdb), ARGIN(const char * cmd));
+typedef void (* debugger_func_t)(PDB_t * pdb, const char * cmd);
 
+static int nomoreargs(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
+{
+    if (*skip_whitespace(cmd) == '\0')
+        return 1;
+    else {
+        Parrot_eprintf(pdb->debugger, "Spurious arg\n");
+        return 0;
+    }
+}
 
-static void
-dbg_break(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_break(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_break)
     TRACEDEB_MSG("dbg_break");
 
     PDB_set_break(pdb->debugee, cmd);
 }
 
-static void
-dbg_continue(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_continue(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_continue)
     TRACEDEB_MSG("dbg_continue");
 
     PDB_continue(pdb->debugee, cmd);
 }
 
-static void
-dbg_delete(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_delete(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_delete)
     TRACEDEB_MSG("dbg_delete");
 
     PDB_delete_breakpoint(pdb->debugee, cmd);
 }
 
-static void
-dbg_disable(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_disable(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_disable)
     TRACEDEB_MSG("dbg_disable");
 
     PDB_disable_breakpoint(pdb->debugee, cmd);
 }
 
-static void
-dbg_disassemble(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_disassemble(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_disassemble)
     TRACEDEB_MSG("dbg_disassemble");
 
     PDB_disassemble(pdb->debugee, cmd);
 }
 
-static void
-dbg_echo(ARGMOD(PDB_t * pdb), SHIM(const char * cmd))
+static void dbg_echo(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_echo)
     TRACEDEB_MSG("dbg_echo");
 
+    if (! nomoreargs(pdb, cmd))
+        return;
+
     if (pdb->state & PDB_ECHO) {
         TRACEDEB_MSG("Disabling echo");
         pdb->state &= ~PDB_ECHO;
@@ -458,26 +318,23 @@
     }
 }
 
-static void
-dbg_enable(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_enable(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_enable)
     PDB_enable_breakpoint(pdb->debugee, cmd);
 }
 
-static void
-dbg_eval(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_eval(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_eval)
     PDB_eval(pdb->debugee, cmd);
 }
 
-static void
-dbg_gcdebug(ARGMOD(PDB_t * pdb), SHIM(const char * cmd))
+static void dbg_gcdebug(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_gcdebug)
     TRACEDEB_MSG("dbg_gcdebug");
 
+    if (! nomoreargs(pdb, cmd))
+        return;
+
     if (pdb->state & PDB_GCDEBUG) {
         TRACEDEB_MSG("Disabling gcdebug mode");
         pdb->state &= ~PDB_GCDEBUG;
@@ -488,111 +345,96 @@
     }
 }
 
-static void
-dbg_help(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_help(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_help)
     TRACEDEB_MSG("dbg_help");
 
     PDB_help(pdb->debugee, cmd);
 }
 
-static void
-dbg_info(ARGIN(PDB_t * pdb), SHIM(const char * cmd))
+static void dbg_info(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_info)
     TRACEDEB_MSG("dbg_info");
 
+    if (! nomoreargs(pdb, cmd))
+        return;
+
     PDB_info(pdb->debugger);
 }
 
-static void
-dbg_list(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_list(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_list)
     TRACEDEB_MSG("dbg_list");
 
     PDB_list(pdb->debugee, cmd);
 }
 
-static void
-dbg_load(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_load(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_load)
     TRACEDEB_MSG("dbg_load");
 
     PDB_load_source(pdb->debugee, cmd);
 }
 
-static void
-dbg_next(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_next(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_next)
     TRACEDEB_MSG("dbg_next");
 
     PDB_next(pdb->debugee, cmd);
 }
 
-static void
-dbg_print(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_print(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_print)
     TRACEDEB_MSG("dbg_print");
 
     PDB_print(pdb->debugee, cmd);
 }
 
-static void
-dbg_quit(ARGMOD(PDB_t * pdb), SHIM(const char * cmd))
+static void dbg_quit(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_quit)
     TRACEDEB_MSG("dbg_quit");
 
+    if (! nomoreargs(pdb, cmd))
+        return;
+
     pdb->state |= PDB_EXIT;
     pdb->state &= ~PDB_STOPPED;
 }
 
-static void
-dbg_run(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_run(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_run)
     TRACEDEB_MSG("dbg_run");
 
     PDB_init(pdb->debugee, cmd);
     PDB_continue(pdb->debugee, NULL);
 }
 
-static void
-dbg_script(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_script(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_script)
     TRACEDEB_MSG("dbg_script");
 
     PDB_script_file(pdb->debugee, cmd);
 }
 
-static void
-dbg_stack(ARGIN(PDB_t * pdb), SHIM(const char * cmd))
+static void dbg_stack(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_stack)
     TRACEDEB_MSG("dbg_stack");
 
+    if (! nomoreargs(pdb, cmd))
+        return;
+
     PDB_backtrace(pdb->debugee);
 }
 
-static void
-dbg_trace(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_trace(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_trace)
     TRACEDEB_MSG("dbg_trace");
 
     PDB_trace(pdb->debugee, cmd);
 }
 
-static void
-dbg_watch(ARGIN(PDB_t * pdb), ARGIN(const char * cmd))
+static void dbg_watch(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
 {
-    ASSERT_ARGS(dbg_watch)
     TRACEDEB_MSG("dbg_watch");
 
     PDB_watchpoint(pdb->debugee, cmd);
@@ -1302,6 +1144,7 @@
         Parrot_ex_throw_from_c_args(interp, NULL, 0, "No file loaded to debug");
 
     if (!(interp->pdb->state & PDB_BREAK)) {
+        TRACEDEB_MSG("Parrot_debugger_break - in BREAK state");
         new_runloop_jump_point(interp);
         if (setjmp(interp->current_runloop->resume)) {
             fprintf(stderr, "Unhandled exception in debugger\n");
@@ -1312,7 +1155,7 @@
         interp->pdb->state     |= PDB_STOPPED;
         interp->pdb->cur_opcode = (opcode_t *)cur_opcode + 1;
 
-        PDB_set_break(interp, NULL);
+        /*PDB_set_break(interp, NULL);*/
 
         debugger_cmdline(interp);
 
@@ -1321,8 +1164,9 @@
     }
     else {
         interp->pdb->cur_opcode = (opcode_t *)cur_opcode + 1;
-        PDB_set_break(interp, NULL);
+        /*PDB_set_break(interp, NULL);*/
     }
+    TRACEDEB_MSG("Parrot_debugger_break done");
 }
 
 /*
@@ -1353,6 +1197,13 @@
     char         *c;
     PDB_t        * const pdb = interp->pdb;
 
+/***********************************
+   **** Testing ****
+   Do not delete yet
+   the commented out
+   parts
+***********************************/
+
     /* flush the buffered data */
     fflush(stdout);
 
@@ -1402,21 +1253,42 @@
 
         c = pdb->cur_command;
 
-        Parrot_io_eprintf(pdb->debugger, "\n(pdb) ");
+        /*Parrot_io_eprintf(pdb->debugger, "\n(pdb) ");*/
+        Parrot_io_eprintf(pdb->debugger, "\n");
 
         /* skip leading whitespace */
+/*
         do {
             ch = fgetc(stdin);
         } while (isspace((unsigned char)ch) && ch != '\n');
+*/
+        {
+        Interp * interpdeb = interp->pdb->debugger;
+        STRING * readline = CONST_STRING(interpdeb, "readline_interactive");
+        STRING * prompt = CONST_STRING(interpdeb, "(pdb) ");
+        STRING *s= Parrot_str_new(interpdeb, NULL, 0);
+        PMC *tmp_stdin = Parrot_io_stdhandle(interpdeb, 0, NULL);
+
+        Parrot_PCCINVOKE(interpdeb,
+            tmp_stdin, readline,
+            "S->S", prompt, & s);
+        {
+        char * aux = Parrot_str_to_cstring(interpdeb, s);
+        strcpy(c, aux);
+        Parrot_str_free_cstring(aux);
+        }
+        ch = '\n';
+        }
 
         /* generate string (no more than buffer length) */
+/*
         while (ch != EOF && ch != '\n' && (i < DEBUG_CMD_BUFFER_LENGTH)) {
             c[i++] = (char)ch;
-            ch     = fgetc(stdin);
+            ch     = fgetc(tmp_stdin);
         }
 
         c[i] = '\0';
-
+*/
         if (ch == -1)
             strcpy(c, "quit");
     }
@@ -1682,6 +1554,8 @@
     unsigned char    regleft;
     int              i, reg_number;
 
+    TRACEDEB_MSG("PDB_cond");
+
     /* Return if no more arguments */
     if (!(command && *command)) {
         Parrot_io_eprintf(interp->pdb->debugger, "No condition specified\n");
@@ -2058,6 +1932,7 @@
         (void)PDB_program_end(interp);
     #endif
     pdb->state |= PDB_RUNNING;
+    pdb->state &= ~PDB_BREAK;
     pdb->state &= ~PDB_STOPPED;
 }
 
@@ -2429,7 +2304,9 @@
     PDB_condition_t  *watchpoint = pdb->watchpoint;
     PDB_breakpoint_t *breakpoint;
 
+/*
     TRACEDEB_MSG("PDB_break");
+*/
 
     /* Check the watchpoints first. */
     while (watchpoint) {

Modified: branches/vtable_morph_change/src/dynext.c
==============================================================================
--- branches/vtable_morph_change/src/dynext.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/dynext.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -397,13 +397,13 @@
         char   * const cinit_func_name = Parrot_str_to_cstring(interp, init_func_name);
 
         /* get load_func */
-        load_func       = (PMC * (*)(PARROT_INTERP))
-            D2FPTR(Parrot_dlsym(handle, cload_func_name));
+        void * dlsymfunc = Parrot_dlsym(handle, cload_func_name);
+        load_func = (PMC * (*)(PARROT_INTERP)) D2FPTR(dlsymfunc);
         Parrot_str_free_cstring(cload_func_name);
 
         /* get init_func */
-        init_func       = (void (*)(PARROT_INTERP, PMC *))
-            D2FPTR(Parrot_dlsym(handle, cinit_func_name));
+        dlsymfunc = Parrot_dlsym(handle, cinit_func_name);
+        init_func = (void (*)(PARROT_INTERP, PMC *)) D2FPTR(dlsymfunc);
         Parrot_str_free_cstring(cinit_func_name);
     }
     else {

Copied: branches/vtable_morph_change/src/dynpmc/pair.pmc (from r36514, trunk/src/dynpmc/pair.pmc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/vtable_morph_change/src/dynpmc/pair.pmc	Tue Feb 10 02:09:33 2009	(r36517, copy of r36514, trunk/src/dynpmc/pair.pmc)
@@ -0,0 +1,356 @@
+/*
+Copyright (C) 2005-2009, The Perl Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/pair.pmc - Pair PMC
+
+=head1 DESCRIPTION
+
+A Pair PMC represents one key => value mapping like a one element hash.
+
+'EclectusPair' subclasses this.
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+#include "pmc_pair.h"
+
+pmclass Pair dynpmc need_ext {
+    ATTR PMC *key;
+    ATTR PMC *value;
+
+/*
+
+=item C<void init()>
+
+Initializes the instance.
+
+=item C<PMC *instantiate(PMC *sig)>
+
+Class method to construct an Integer according to passed arguments.
+
+=cut
+
+*/
+
+    VTABLE void init() {
+        PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_Pair_attributes);
+        PObj_custom_mark_SET(SELF);
+    }
+
+    VTABLE PMC *instantiate(PMC *sig) {
+        return PMCNULL;
+
+        /* TODO -- really create this thing */
+#if 0
+        PMC * const  _class = REG_PMC(interp, 2);
+        Parrot_Pair_attributes *pair   = PARROT_PAIR(SELF);
+        const int    argcP  = REG_INT(interp, 3);
+        const int    argcS  = REG_INT(interp, 2);
+
+        SELF = pmc_new(INTERP, _class->vtable->base_type);
+        if (argcS == 1 && argcP == 1) {
+            PObj_key_is_string_SET(SELF);
+            pair->key   = REG_STR(interp, 5);
+            pair->value = REG_PMC(interp, 5);
+        }
+        else if (argcP == 2) {
+            pair->key   = REG_PMC(interp, 5);
+            pair->value = REG_PMC(interp, 6);
+        }
+        else
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+                "wrong argument count for Pair creation");
+
+        return SELF;
+#endif
+    }
+/*
+
+=item C<void mark()>
+
+Marks the hash as live.
+
+=cut
+
+*/
+
+    VTABLE void mark() {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+
+        if (pair->key)
+            pobject_lives(INTERP, (PObj *)pair->key);
+
+        if (pair->value)
+            pobject_lives(INTERP, (PObj *)pair->value);
+    }
+
+/*
+
+=item C<PMC *get_pmc_keyed_str(STRING *key)>
+
+=item C<PMC *get_pmc_keyed(PMC *key)>
+
+=cut
+
+*/
+
+    VTABLE PMC *get_pmc_keyed_str(STRING *key) {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+        /* check key ? */
+        return pair->value;
+    }
+
+    VTABLE PMC *get_pmc_keyed(PMC *key) {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+        /* check key ? */
+        return pair->value;
+    }
+
+/*
+
+=item C<void set_pmc_keyed(PMC *key, PMC *value)>
+
+=item C<void set_pmc_keyed_str(STRING *key, PMC *value)>
+
+Set key and value. The key can only set once.
+
+=item C<void assign_pmc(PMC *value)>
+
+Set the value of the Pair.
+
+=cut
+
+*/
+
+    VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+
+        if (pair->key)
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+                "attempt to set existing Pair key");
+
+
+        pair->key   = key;
+        pair->value = value;
+    }
+
+
+    VTABLE void set_pmc_keyed_str(STRING *key, PMC *value) {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+        PMC                *key_pmc;
+
+        if (pair->key)
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+                "attempt to set existing Pair key");
+
+
+        key_pmc = pmc_new(interp, enum_class_String);
+        VTABLE_set_string_native(interp, key_pmc, key);
+
+        pair->key   = key_pmc;
+        pair->value = value;
+    }
+
+    VTABLE void assign_pmc(PMC *value) {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+        pair->value              = value;
+    }
+
+/*
+
+=item C<void set_pmc(PMC *pair)>
+
+Sets this pair to hold the value of another.
+
+=cut
+
+*/
+
+    void set_pmc(PMC *pair) {
+        if (pair->vtable->base_type == SELF->vtable->base_type) {
+            Parrot_Pair_attributes * const from = PARROT_PAIR(SELF);
+            Parrot_Pair_attributes * const to   = PARROT_PAIR(SELF);
+
+            to->key   = from->key;
+            to->value = from->value;
+        }
+        else
+            Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
+                "Can only set a pair to another pair.");
+    }
+
+/*
+
+=item C<INTVAL is_equal(PMC *value)>
+
+The C<==> operation.
+
+Check if two Pairs hold the same keys and values.
+
+=cut
+
+*/
+
+    VTABLE INTVAL is_equal(PMC *value) {
+        Parrot_Pair_attributes * const from = PARROT_PAIR(SELF);
+        Parrot_Pair_attributes * const to   = PARROT_PAIR(SELF);
+        PMC *p1, *p2;
+        PMC *k1, *k2;
+        INTVAL result;
+
+        if (value->vtable->base_type != SELF->vtable->base_type)
+            return 0;
+
+        k1 = from->key;
+        k2 = to->key;
+
+        Parrot_mmd_multi_dispatch_from_c_args(INTERP, "is_equal",
+            "PP->I", k1, k2, &result);
+        if (!result)
+            return 0;
+
+        p1 = from->value;
+        p2 = to->value;
+
+        if (!p1 && !p2)
+            return 1;
+        else
+            return 0;
+    }
+
+/*
+
+=item C<void visit(visit_info *info)>
+
+Used during archiving to visit the elements in the pair.
+
+=item C<void freeze(visit_info *info)>
+
+Used to archive the Pair.
+
+=item C<void thaw(visit_info *info)>
+
+Used to unarchive the Pair.
+
+=cut
+
+*/
+
+    VTABLE void visit(visit_info *info) {
+        PMC               **pos;
+        Parrot_Pair_attributes * const pair     = PARROT_PAIR(SELF);
+        IMAGE_IO    * const io       = info->image_io;
+        DPOINTER   ** const temp_pos = (DPOINTER **)pair->key;
+        info->thaw_ptr               = (PMC **)temp_pos;
+        (info->visit_pmc_now)(INTERP, (PMC *)temp_pos, info);
+
+        pos            = &pair->value;
+        info->thaw_ptr = pos;
+
+        (info->visit_pmc_now)(INTERP, *pos, info);
+
+        SUPER(info);
+    }
+
+    VTABLE void freeze(visit_info *info) {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+        IMAGE_IO    * const io   = info->image_io;
+        SUPER(info);
+        VTABLE_push_pmc(INTERP, io, pair->key);
+        VTABLE_push_pmc(INTERP, io, pair->value);
+    }
+
+    VTABLE void thaw(visit_info *info) {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+        IMAGE_IO    * const io   = info->image_io;
+
+        SUPER(info);
+
+        pair->key   = VTABLE_shift_pmc(interp, io);
+        pair->value = VTABLE_shift_pmc(interp, io);
+    }
+/*
+
+=back
+
+=head2 Methods
+
+=over 4
+
+=item C<METHOD key()>
+
+Return the key of the pair.
+
+=cut
+
+*/
+
+    METHOD key() {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+        PMC                *key  = pair->key;
+
+        RETURN(PMC *key);
+    }
+
+/*
+
+=item C<METHOD value()>
+
+Return the value of the pair.
+
+=cut
+
+*/
+
+    METHOD value() {
+        Parrot_Pair_attributes * const pair  = PARROT_PAIR(SELF);
+        PMC         * const value = pair->value;
+        RETURN(PMC *value);
+    }
+
+/*
+
+=item C<METHOD kv()>
+
+Return a tuple of (key, value) for the pair.
+
+=cut
+
+*/
+
+    METHOD kv() {
+        Parrot_Pair_attributes * const pair = PARROT_PAIR(SELF);
+        PMC         * const t    = pmc_new(INTERP,
+            Parrot_get_ctx_HLL_type(INTERP, enum_class_FixedPMCArray));
+
+        VTABLE_set_integer_native(INTERP, t, 2);
+        VTABLE_set_pmc_keyed_int(INTERP, t, 0, pair->key);
+
+        VTABLE_set_pmc_keyed_int(INTERP, t, 1, pair->value);
+        RETURN(PMC *t);
+    }
+}
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/vtable_morph_change/src/exceptions.c
==============================================================================
--- branches/vtable_morph_change/src/exceptions.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/exceptions.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -115,9 +115,12 @@
     Parrot_io_flush(interp, Parrot_io_STDOUT(interp));
     Parrot_io_flush(interp, Parrot_io_STDERR(interp));
 
-    if (interp->debugger) {
-        Parrot_io_flush(interp->debugger, Parrot_io_STDOUT(interp->debugger));
-        Parrot_io_flush(interp->debugger, Parrot_io_STDERR(interp->debugger));
+    if (interp->pdb) {
+        Interp * interpdeb = interp->pdb->debugger;
+        if (interpdeb) {
+            Parrot_io_flush(interpdeb, Parrot_io_STDOUT(interpdeb));
+            Parrot_io_flush(interpdeb, Parrot_io_STDERR(interpdeb));
+        }
     }
 
     if (Parrot_str_not_equal(interp, message, CONST_STRING(interp, "")) == 1) {
@@ -690,7 +693,7 @@
     fprintf(stderr, "\n\
 We highly suggest you notify the Parrot team if you have not been working on\n\
 Parrot.  Use parrotbug (located in parrot's root directory) or send an\n\
-e-mail to parrot-porters at perl.org.\n\
+e-mail to parrot-dev at lists.parrot.org.\n\
 Include the entire text of this error message and the text of the script that\n\
 generated the error.  If you've made any modifications to Parrot, please\n\
 describe them as well.\n\n");

Modified: branches/vtable_morph_change/src/exec_save.c
==============================================================================
--- branches/vtable_morph_change/src/exec_save.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/exec_save.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -49,7 +49,7 @@
 void
 Parrot_exec_save(PARROT_INTERP, Parrot_exec_objfile_t *obj, const char *file)
 {
-    FILE * fp = fopen(file, "w");
+    FILE * const fp = fopen(file, "w");
     int    i;
     struct exec header;
     struct relocation_info rellocation;
@@ -558,6 +558,7 @@
     for (i = 0; i < obj->data.size; i++)
         fprintf(fp, "%c", obj->data.code[i]);
     /* Text rellocations */
+    /* XXX This is an infinite loop.  When i = 0, i-- goes to very large. */
     for (i = obj->text_rellocation_count - 1; i >= 0; i--) {
         save_int(fp, obj->text_rellocation_table[i].offset);
         save_short(fp, obj->text_rellocation_table[i].symbol_number);

Modified: branches/vtable_morph_change/src/gc/mark_sweep.c
==============================================================================
--- branches/vtable_morph_change/src/gc/mark_sweep.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/gc/mark_sweep.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -160,7 +160,7 @@
     if (arena_base->DOD_block_level)
         return;
 
-    if (interp->debugger) {
+    if (interp->pdb && interp->pdb->debugger) {
         /*
          * if the other interpreter did a DOD run, it can set
          * live bits of shared objects, but these aren't reset, because

Modified: branches/vtable_morph_change/src/jit/i386/exec_dep.h
==============================================================================
--- branches/vtable_morph_change/src/jit/i386/exec_dep.h	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/jit/i386/exec_dep.h	Tue Feb 10 02:09:33 2009	(r36517)
@@ -19,28 +19,50 @@
 /* HEADERIZER BEGIN: src/exec_dep.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-void offset_fixup(Parrot_exec_objfile_t *obj);
-void Parrot_exec_cpcf_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-        __attribute__nonnull__(2);
+void offset_fixup(ARGMOD(Parrot_exec_objfile_t *obj))
+        __attribute__nonnull__(1)
+        FUNC_MODIFIES(*obj);
+
+void Parrot_exec_cpcf_op(ARGMOD(Parrot_jit_info_t *jit_info), PARROT_INTERP)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*jit_info);
+
+void Parrot_exec_normal_op(
+     ARGMOD(Parrot_jit_info_t *jit_info),
+    PARROT_INTERP)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*jit_info);
+
+void Parrot_exec_normal_op(
+    ARGMOD(Parrot_jit_info_t *jit_info),
+    PARROT_INTERP)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*jit_info);
+
+void Parrot_exec_restart_op(
+    ARGMOD(Parrot_jit_info_t *jit_info),
+    PARROT_INTERP)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        FUNC_MODIFIES(*jit_info);
 
-void Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-        __attribute__nonnull__(2);
-
-void Parrot_exec_normal_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-        __attribute__nonnull__(2);
-
-void Parrot_exec_restart_op(Parrot_jit_info_t *jit_info, PARROT_INTERP)
-        __attribute__nonnull__(2);
-
-#define ASSERT_ARGS_offset_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_offset_fixup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(obj)
 #define ASSERT_ARGS_Parrot_exec_cpcf_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+       PARROT_ASSERT_ARG(jit_info) \
+    || PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_exec_normal_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+       PARROT_ASSERT_ARG(jit_info) \
+    || PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_exec_normal_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+       PARROT_ASSERT_ARG(jit_info) \
+    || PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_Parrot_exec_restart_op __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+       PARROT_ASSERT_ARG(jit_info) \
+    || PARROT_ASSERT_ARG(interp)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: src/exec_dep.c */
 

Modified: branches/vtable_morph_change/src/library.c
==============================================================================
--- branches/vtable_morph_change/src/library.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/library.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -272,6 +272,14 @@
     return VTABLE_get_pmc_keyed_int(interp, lib_paths, which);
 }
 
+static const char path_separator = '/';
+
+#ifdef WIN32
+
+static const char win32_path_separator = '\\';
+
+#endif
+
 /*
 
 =item C<static int is_abs_path>
@@ -294,26 +302,25 @@
         return 0;
     PARROT_ASSERT(file->encoding == Parrot_fixed_8_encoding_ptr ||
             file->encoding == Parrot_utf8_encoding_ptr);
+
+    /* XXX  ../foo, ./bar */
+    if (file_name[0] == path_separator
 #ifdef WIN32
-    if (file_name[0] == '\\' || file_name[0] == '/' ||
+            || (file_name[0] == win32_path_separator ||
             (isalpha((unsigned char)file_name[0]) && file->strlen > 2 &&
              (strncmp(file_name+1, ":\\", 2) == 0 ||
               strncmp(file_name+1, ":/",  2) == 0)))
-#else
-    if (file_name[0] == '/')     /* XXX  ../foo, ./bar */
 #endif
+            /* no space before closing paren */)
         {
             return 1;
         }
     return 0;
 }
 
-static const char path_separator = '/';
 
 #ifdef WIN32
 
-static const char win32_path_separator = '\\';
-
 /*
 
 =item C<static void cnv_to_win32_filesep>
@@ -510,7 +517,6 @@
     STRING * const bytecode_extension = CONST_STRING(interp, ".pbc");
     STRING * const pir_extension      = CONST_STRING(interp, ".pir");
     STRING * const pasm_extension     = CONST_STRING(interp, ".pasm");
-    int guess;
 
     test_path = Parrot_str_copy(interp, path);
 
@@ -531,7 +537,7 @@
             STRING *orig_ext = Parrot_str_substr(interp, test_path, -4, 4, NULL, 0);
             /* First try substituting .pbc for the .pir extension */
             if (Parrot_str_not_equal(interp, orig_ext, pir_extension) == 0) {
-                STRING *without_ext = Parrot_str_chopn(interp, test_path, 4);
+                STRING * const without_ext = Parrot_str_chopn(interp, test_path, 4);
                 test_path = Parrot_str_append(interp, without_ext, bytecode_extension);
                 result = try_load_path(interp, test_path);
                 if (result)
@@ -539,7 +545,7 @@
             }
             /* Next try substituting .pir, then .pasm for the .pbc extension */
             else if (Parrot_str_not_equal(interp, orig_ext, bytecode_extension) == 0) {
-                STRING *without_ext = Parrot_str_chopn(interp, test_path, 4);
+                STRING * const without_ext = Parrot_str_chopn(interp, test_path, 4);
                 test_path = Parrot_str_append(interp, without_ext, pir_extension);
                 result = try_load_path(interp, test_path);
                 if (result)
@@ -555,9 +561,9 @@
 
         /* Finally, try substituting .pbc for the .pasm extension. */
         if (Parrot_str_byte_length(interp, test_path) > 5) {
-            STRING *orig_ext = Parrot_str_substr(interp, test_path, -5, 5, NULL, 0);
+            STRING * const orig_ext = Parrot_str_substr(interp, test_path, -5, 5, NULL, 0);
             if (Parrot_str_not_equal(interp, orig_ext, pasm_extension) == 0) {
-                STRING *without_ext = Parrot_str_chopn(interp, test_path, 5);
+                STRING * const without_ext = Parrot_str_chopn(interp, test_path, 5);
                 test_path = Parrot_str_append(interp, without_ext, bytecode_extension);
                 result = try_load_path(interp, test_path);
                 if (result)
@@ -592,7 +598,7 @@
     PMC * const iglobals = interp->iglobals;
     PMC * const lib_paths = VTABLE_get_pmc_keyed_int(interp, iglobals,
         IGLOBALS_LIB_PATHS);
-    PMC * paths = VTABLE_get_pmc_keyed_int(interp, lib_paths, which);
+    PMC * const paths = VTABLE_get_pmc_keyed_int(interp, lib_paths, which);
     STRING * const path_str = Parrot_str_new(interp, path, 0);
     VTABLE_push_string(interp, paths, path_str);
 }

Modified: branches/vtable_morph_change/src/oo.c
==============================================================================
--- branches/vtable_morph_change/src/oo.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/oo.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -909,7 +909,9 @@
     else
         result = "no";
 
-    tracer = interp->debugger ? interp->debugger : interp;
+    tracer = (interp->pdb && interp->pdb->debugger) ?
+        interp->pdb->debugger :
+        interp;
     Parrot_io_eprintf(tracer, "# find_method class '%Ss' method '%Ss': %s\n",
             class_name, name, result);
 }

Modified: branches/vtable_morph_change/src/ops/core.ops
==============================================================================
--- branches/vtable_morph_change/src/ops/core.ops	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/ops/core.ops	Tue Feb 10 02:09:33 2009	(r36517)
@@ -96,8 +96,8 @@
 
 =item B<load_bytecode>(in STR)
 
-Load Parrot bytecode from file $1, and
-RT#42381 search the library path to locate the file.
+Load Parrot bytecode from file $1, and search the library path to locate the
+file.
 
 =cut
 
@@ -105,11 +105,23 @@
 }
 
 inline op cpu_ret() {
+    /* We only want to call __asm__("ret") if we're in the JIT core. Otherwise
+       we want to throw an error. Seriously people: Do not use this opcode
+       directly in PIR. Ever. It absolutely makes no sense and it doesn't do
+       anything productive. You've been warned. */
+    if (interp->run_core & PARROT_JIT_CORE) {
 #ifdef __GNUC__
 #  ifdef I386
-    __asm__("ret");
+        __asm__("ret");
 #  endif
 #endif
+    }
+    else {
+        opcode_t * const handler= Parrot_ex_throw_from_op_args(interp,
+            NULL, EXCEPTION_INVALID_OPERATION,
+            "cpu_ret: May not use this opcode from PIR source");
+        goto ADDRESS(handler);
+    }
 }
 
 inline op check_events() :base_core :flow {
@@ -280,8 +292,8 @@
     next = INTVAL2PTR(opcode_t *, return_addr);
 
     /* The return address must be within the current code segment. */
-    if (! ( next >= interp->code->base.data
-            && next < (interp->code->base.data + interp->code->base.size)) ) {
+    if (! (next >= interp->code->base.data
+           && next < (interp->code->base.data + interp->code->base.size))) {
         opcode_t *handler = Parrot_ex_throw_from_op_args(interp, dest,
             EXCEPTION_INVALID_OPERATION,
             "Address for 'local_return' must be within the current code segment");
@@ -366,12 +378,12 @@
 
 =cut
 
-inline op if(invar INT, inconst LABEL) {
+inline op if (invar INT, inconst LABEL) {
     if ($1 != 0)
         goto OFFSET($2);
 }
 
-inline op if(invar NUM, inconst LABEL) {
+inline op if (invar NUM, inconst LABEL) {
     if (!FLOAT_IS_ZERO($1))
         goto OFFSET($2);
 }
@@ -381,7 +393,7 @@
         goto OFFSET($2);
 }
 
-op if(invar PMC, inconst LABEL) {
+op if (invar PMC, inconst LABEL) {
     if (VTABLE_get_bool(interp, $1))
         goto OFFSET($2);
 }

Modified: branches/vtable_morph_change/src/ops/string.ops
==============================================================================
--- branches/vtable_morph_change/src/ops/string.ops	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/ops/string.ops	Tue Feb 10 02:09:33 2009	(r36517)
@@ -49,8 +49,7 @@
 
 =item B<chr>(out STR, in INT)
 
-The character specified by codepoint integer $2 in the current character set
-is returned in string $1.
+The character specified by codepoint integer $2 is returned in string $1.
 
 =cut
 

Modified: branches/vtable_morph_change/src/packdump.c
==============================================================================
--- branches/vtable_morph_change/src/packdump.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/packdump.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -10,7 +10,7 @@
 
 =head1 DESCRIPTION
 
-This is only used by the PBC dumper C<pdump>.
+This is only used by the PBC dumper C<pbc_dump>.
 
 =head2 Functions
 
@@ -397,7 +397,7 @@
 
 =head1 SEE ALSO
 
-F<src/pdump.c>.
+F<src/pbc_dump.c>.
 
 =cut
 

Modified: branches/vtable_morph_change/src/packfile.c
==============================================================================
--- branches/vtable_morph_change/src/packfile.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/packfile.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -2882,8 +2882,8 @@
      * which gives misleading trace messages
      */
     if (really && Interp_trace_TEST(interp, PARROT_TRACE_SUB_CALL_FLAG)) {
-        Interp * const tracer = interp->debugger ?
-            interp->debugger : interp;
+        Interp * const tracer = interp->pdb->debugger ?
+            interp->pdb->debugger : interp;
         Parrot_io_eprintf(tracer, "*** switching to %s\n",
                 new_cs->base.name);
     }

Modified: branches/vtable_morph_change/src/parrot_debugger.c
==============================================================================
--- branches/vtable_morph_change/src/parrot_debugger.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/parrot_debugger.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -156,8 +156,6 @@
 
     /*Parrot_set_config_hash();  TODO link with cfg */
 
-    /* attach pdb structure */
-    interp->debugger = pdb->debugger;
     pdb->state       = PDB_ENTER;
 
     Parrot_block_GC_mark(interp);

Copied: branches/vtable_morph_change/src/pbc_dump.c (from r36514, trunk/src/pbc_dump.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/vtable_morph_change/src/pbc_dump.c	Tue Feb 10 02:09:33 2009	(r36517, copy of r36514, trunk/src/pbc_dump.c)
@@ -0,0 +1,327 @@
+/*
+Copyright (C) 2001-2003, The Perl Foundation.
+$Id$
+
+=head1 NAME
+
+pbc_dump - Dump or convert Parrot bytecode (PBC) files
+
+=head1 SYNOPSIS
+
+ pbc_dump [-tdh] [--terse|--disassemble|--header-only] file.pbc
+
+ pbc_dump -o converted.pbc file.pbc
+
+=head1 DESCRIPTION
+
+A program to dump pack files to human readable form.
+
+=head2 Command-Line Options
+
+=over 4
+
+=item C<-d>
+
+Disassemble bytecode segments.
+
+=item C<-h>
+
+Dump the bytecode header only.
+
+=item C<-t>
+
+Terse output.
+
+=item C<-o converted.pbc>
+
+Repacks a PBC file into the platform's native binary format for better
+efficiency on reading non-native PBCs.
+
+=back
+
+=head2 Functions
+
+=over 4
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+#include "parrot/embed.h"
+#include "parrot/oplib/ops.h"
+
+/*
+
+=item C<static void
+const_dump(PARROT_INTERP, const PackFile_Segment *segp)>
+
+Dump the constant table.
+
+=cut
+
+*/
+
+static void
+const_dump(PARROT_INTERP, const PackFile_Segment *segp)
+{
+    Parrot_io_printf(interp, "%s => [\n", segp->name);
+    PackFile_ConstTable_dump(interp, (const PackFile_ConstTable *)segp);
+    Parrot_io_printf(interp, "],\n");
+}
+
+/*
+
+=item C<static void
+fixup_dump(PARROT_INTERP, const PackFile_Segment *segp)>
+
+Dump the fixup table.
+
+=cut
+
+*/
+
+static void
+fixup_dump(PARROT_INTERP, const PackFile_Segment *segp)
+{
+    Parrot_io_printf(interp, "%s => [\n", segp->name);
+    PackFile_Fixup_dump(interp, (const PackFile_FixupTable *)segp);
+    Parrot_io_printf(interp, "],\n");
+}
+
+/*
+
+=item C<static void
+disas_dump(PARROT_INTERP, const PackFile_Segment *self)>
+
+Disassemble and dump.
+
+=cut
+
+*/
+
+static void
+disas_dump(PARROT_INTERP, const PackFile_Segment *self)
+{
+    opcode_t *pc;
+    size_t i, n;
+    Parrot_io_printf(interp, "%s => [ # %d ops at offs 0x%x\n",
+            self->name, (int)self->size, (int)self->file_offset + 4);
+    pc = self->data;
+    while (pc < self->data + self->size) {
+        /* trace_op_dump(interp, self->pf->src, pc); */
+        Parrot_io_printf(interp, " %04x:  ", (int) (pc - self->data));
+        n = (size_t)interp->op_info_table[*pc].op_count;
+        for (i = 0; i < 6; i++)
+            if (i < n)
+                Parrot_io_printf(interp, "%08lx ", (unsigned long) pc[i]);
+            else
+                Parrot_io_printf(interp, "         ");
+        Parrot_io_printf(interp, "%s\n",
+                interp->op_info_table[*pc].full_name);
+        ADD_OP_VAR_PART(interp, interp->code, pc, n);
+        pc += n;
+    }
+    Parrot_io_printf(interp, "]\n");
+}
+
+/*
+
+=item C<static void
+PackFile_header_dump(PARROT_INTERP, PackFile *pf)>
+
+Dump the header.
+
+=cut
+
+*/
+
+static void
+PackFile_header_dump(PARROT_INTERP, PackFile *pf)
+{
+    Parrot_io_printf(interp, "HEADER => [\n");
+    Parrot_io_printf(interp, "\twordsize  = %d", pf->header->wordsize);
+    Parrot_io_printf(interp, "\t(interpreter's wordsize/INTVAL = %d/%d)\n",
+                     sizeof (opcode_t), sizeof (INTVAL));
+    Parrot_io_printf(interp, "\tbyteorder = %d", pf->header->byteorder);
+    Parrot_io_printf(interp, "\t(interpreter's byteorder       = %d)\n",
+            PARROT_BIGENDIAN);
+    Parrot_io_printf(interp, "\tfloattype = %d", pf->header->floattype);
+    Parrot_io_printf(interp, "\t(interpreter's NUMVAL_SIZE     = %d)\n", NUMVAL_SIZE);
+    Parrot_io_printf(interp, "\tparrot-version %d.%d.%d, bytecode-version %d.%d\n",
+                     pf->header->major, pf->header->minor, pf->header->patch,
+                     pf->header->bc_major, pf->header->bc_minor);
+    Parrot_io_printf(interp, "\tUUID type = %d, UUID size = %d\n",
+                     pf->header->uuid_type, pf->header->uuid_size);
+    Parrot_io_printf(interp, "\t%s endianize, %s opcode, %s numval transform\n",
+            pf->need_endianize ? "**need**" : "no",
+            pf->need_wordsize ? "**need**" : "no",
+            pf->fetch_nv ? "**need**" : "no");
+    Parrot_io_printf(interp, "\tdirformat = %d\n", pf->header->dir_format);
+    Parrot_io_printf(interp, "]\n");
+}
+
+/*
+
+=item C<static void help(void)>
+
+Print out the user help info.
+
+=cut
+
+*/
+
+static void help(void)
+{
+    printf("pbc_dump - dump or convert parrot bytecode (PBC) files\n");
+    printf("usage:\n");
+    printf("pbc_dump [-tdh] [--terse|--disassemble|--header-only] file.pbc\n");
+    printf("pbc_dump -o converted.pbc file.pbc\n\n");
+    printf("\t-d ... disassemble bytecode segments\n");
+    printf("\t-h ... dump header only\n");
+    printf("\t-t ... terse output\n");
+    printf("\n\t-o converted.pbc repacks a PBC file into "
+           "the platform's native\n");
+    printf("\t   binary format for better efficiency on reading "
+           "non native PBCs\n");
+    exit(EXIT_SUCCESS);
+}
+
+static struct longopt_opt_decl options[] = {
+    { 'h', 'h', OPTION_optional_FLAG, { "--header-only" } },
+    { '?', '?', OPTION_optional_FLAG, { "--help" } },
+    { 't', 't', OPTION_optional_FLAG, { "--terse" } },
+    { 'd', 'd', OPTION_optional_FLAG, { "--disassemble" } },
+    { 'o', 'o', OPTION_required_FLAG, { "--output" } }
+};
+
+/*
+
+=item C<int
+main(int argc, char **argv)>
+
+The run loop. Process the command-line arguments and dump accordingly.
+
+=cut
+
+*/
+
+int
+main(int argc, const char **argv)
+{
+    PackFile *pf;
+    Interp *interp;
+    int terse = 0;
+    int disas = 0;
+    int convert = 0;
+    int header = 0;
+    const char *file = NULL;
+    struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT;
+    int status;
+
+    if (argc < 2) {
+        help();
+    }
+    interp = Parrot_new(NULL);
+    /* init and set top of stack */
+    Parrot_init_stacktop(interp, &status);
+    while ((status = longopt_get(interp,
+                    argc, argv, options, &opt)) > 0) {
+        switch (opt.opt_id) {
+            case 'h':
+                header = 1;
+                break;
+            case 't':
+                terse = 1;
+                break;
+            case 'd':
+                disas = 1;
+                break;
+            case 'o':
+                file = opt.opt_arg;
+                convert = 1;
+                break;
+            case '?':
+            default:
+                help();
+                break;
+        }
+    }
+    if (status == -1) {
+        help();
+    }
+    argc -= opt.opt_index;
+    argv += opt.opt_index;
+
+
+    pf = Parrot_readbc(interp, *argv);
+
+    if (!pf) {
+        printf("Can't read PBC\n");
+        return 1;
+    }
+    Parrot_loadbc(interp, pf);
+    if (convert) {
+        size_t size;
+        opcode_t *pack;
+        FILE *fp;
+
+        size = PackFile_pack_size(interp,
+                interp->code->base.pf) * sizeof (opcode_t);
+        pack = (opcode_t*) mem_sys_allocate(size);
+        if (!pack) {
+            printf("out of mem\n");
+            exit(EXIT_FAILURE);
+        }
+        PackFile_pack(interp, interp->code->base.pf, pack);
+        if (STREQ(file, "-"))
+            fp = stdout;
+        else if ((fp = fopen(file, "wb")) == 0) {
+            printf("Couldn't open %s\n", file);
+            exit(EXIT_FAILURE);
+        }
+
+        if ((1 != fwrite(pack, size, 1, fp))) {
+            printf("Couldn't write %s\n", file);
+            exit(EXIT_FAILURE);
+        }
+        fclose(fp);
+        mem_sys_free(pack);
+        Parrot_exit(interp, 0);
+    }
+
+    PackFile_header_dump(interp, pf);
+    if (header) {
+        Parrot_exit(interp, 0);
+    }
+    /* install a dumper function */
+    if (!terse) {
+        pf->PackFuncs[PF_CONST_SEG].dump = const_dump;
+        pf->PackFuncs[PF_FIXUP_SEG].dump = fixup_dump;
+    }
+    if (disas)
+        pf->PackFuncs[PF_BYTEC_SEG].dump = disas_dump;
+    /* do a directory dump, which dumps segs then */
+    PackFile_Segment_dump(interp, &pf->directory.base);
+
+    Parrot_exit(interp, 0);
+}
+
+/*
+
+=back
+
+=head1 SEE ALSO
+
+F<src/packdump.c>.
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Deleted: branches/vtable_morph_change/src/pdump.c
==============================================================================
--- branches/vtable_morph_change/src/pdump.c	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,327 +0,0 @@
-/*
-Copyright (C) 2001-2003, The Perl Foundation.
-$Id$
-
-=head1 NAME
-
-pdump - Dump or convert Parrot bytecode (PBC) files
-
-=head1 SYNOPSIS
-
- pdump [-tdh] [--terse|--disassemble|--header-only] file.pbc
-
- pdump -o converted.pbc file.pbc
-
-=head1 DESCRIPTION
-
-A program to dump pack files to human readable form.
-
-=head2 Command-Line Options
-
-=over 4
-
-=item C<-d>
-
-Disassemble bytecode segments.
-
-=item C<-h>
-
-Dump the bytecode header only.
-
-=item C<-t>
-
-Terse output.
-
-=item C<-o converted.pbc>
-
-Repacks a PBC file into the platform's native binary format for better
-efficiency on reading non-native PBCs.
-
-=back
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-#include "parrot/embed.h"
-#include "parrot/oplib/ops.h"
-
-/*
-
-=item C<static void
-const_dump(PARROT_INTERP, const PackFile_Segment *segp)>
-
-Dump the constant table.
-
-=cut
-
-*/
-
-static void
-const_dump(PARROT_INTERP, const PackFile_Segment *segp)
-{
-    Parrot_io_printf(interp, "%s => [\n", segp->name);
-    PackFile_ConstTable_dump(interp, (const PackFile_ConstTable *)segp);
-    Parrot_io_printf(interp, "],\n");
-}
-
-/*
-
-=item C<static void
-fixup_dump(PARROT_INTERP, const PackFile_Segment *segp)>
-
-Dump the fixup table.
-
-=cut
-
-*/
-
-static void
-fixup_dump(PARROT_INTERP, const PackFile_Segment *segp)
-{
-    Parrot_io_printf(interp, "%s => [\n", segp->name);
-    PackFile_Fixup_dump(interp, (const PackFile_FixupTable *)segp);
-    Parrot_io_printf(interp, "],\n");
-}
-
-/*
-
-=item C<static void
-disas_dump(PARROT_INTERP, const PackFile_Segment *self)>
-
-Disassemble and dump.
-
-=cut
-
-*/
-
-static void
-disas_dump(PARROT_INTERP, const PackFile_Segment *self)
-{
-    opcode_t *pc;
-    size_t i, n;
-    Parrot_io_printf(interp, "%s => [ # %d ops at offs 0x%x\n",
-            self->name, (int)self->size, (int)self->file_offset + 4);
-    pc = self->data;
-    while (pc < self->data + self->size) {
-        /* trace_op_dump(interp, self->pf->src, pc); */
-        Parrot_io_printf(interp, " %04x:  ", (int) (pc - self->data));
-        n = (size_t)interp->op_info_table[*pc].op_count;
-        for (i = 0; i < 6; i++)
-            if (i < n)
-                Parrot_io_printf(interp, "%08lx ", (unsigned long) pc[i]);
-            else
-                Parrot_io_printf(interp, "         ");
-        Parrot_io_printf(interp, "%s\n",
-                interp->op_info_table[*pc].full_name);
-        ADD_OP_VAR_PART(interp, interp->code, pc, n);
-        pc += n;
-    }
-    Parrot_io_printf(interp, "]\n");
-}
-
-/*
-
-=item C<static void
-PackFile_header_dump(PARROT_INTERP, PackFile *pf)>
-
-Dump the header.
-
-=cut
-
-*/
-
-static void
-PackFile_header_dump(PARROT_INTERP, PackFile *pf)
-{
-    Parrot_io_printf(interp, "HEADER => [\n");
-    Parrot_io_printf(interp, "\twordsize  = %d", pf->header->wordsize);
-    Parrot_io_printf(interp, "\t(interpreter's wordsize/INTVAL = %d/%d)\n",
-                     sizeof (opcode_t), sizeof (INTVAL));
-    Parrot_io_printf(interp, "\tbyteorder = %d", pf->header->byteorder);
-    Parrot_io_printf(interp, "\t(interpreter's byteorder       = %d)\n",
-            PARROT_BIGENDIAN);
-    Parrot_io_printf(interp, "\tfloattype = %d", pf->header->floattype);
-    Parrot_io_printf(interp, "\t(interpreter's NUMVAL_SIZE     = %d)\n", NUMVAL_SIZE);
-    Parrot_io_printf(interp, "\tparrot-version %d.%d.%d, bytecode-version %d.%d\n",
-                     pf->header->major, pf->header->minor, pf->header->patch,
-                     pf->header->bc_major, pf->header->bc_minor);
-    Parrot_io_printf(interp, "\tUUID type = %d, UUID size = %d\n",
-                     pf->header->uuid_type, pf->header->uuid_size);
-    Parrot_io_printf(interp, "\t%s endianize, %s opcode, %s numval transform\n",
-            pf->need_endianize ? "**need**" : "no",
-            pf->need_wordsize ? "**need**" : "no",
-            pf->fetch_nv ? "**need**" : "no");
-    Parrot_io_printf(interp, "\tdirformat = %d\n", pf->header->dir_format);
-    Parrot_io_printf(interp, "]\n");
-}
-
-/*
-
-=item C<static void help(void)>
-
-Print out the user help info.
-
-=cut
-
-*/
-
-static void help(void)
-{
-    printf("pdump - dump or convert parrot bytecode (PBC) files\n");
-    printf("usage:\n");
-    printf("pdump [-tdh] [--terse|--disassemble|--header-only] file.pbc\n");
-    printf("pdump -o converted.pbc file.pbc\n\n");
-    printf("\t-d ... disassemble bytecode segments\n");
-    printf("\t-h ... dump header only\n");
-    printf("\t-t ... terse output\n");
-    printf("\n\t-o converted.pbc repacks a PBC file into "
-           "the platform's native\n");
-    printf("\t   binary format for better efficiency on reading "
-           "non native PBCs\n");
-    exit(EXIT_SUCCESS);
-}
-
-static struct longopt_opt_decl options[] = {
-    { 'h', 'h', OPTION_optional_FLAG, { "--header-only" } },
-    { '?', '?', OPTION_optional_FLAG, { "--help" } },
-    { 't', 't', OPTION_optional_FLAG, { "--terse" } },
-    { 'd', 'd', OPTION_optional_FLAG, { "--disassemble" } },
-    { 'o', 'o', OPTION_required_FLAG, { "--output" } }
-};
-
-/*
-
-=item C<int
-main(int argc, char **argv)>
-
-The run loop. Process the command-line arguments and dump accordingly.
-
-=cut
-
-*/
-
-int
-main(int argc, const char **argv)
-{
-    PackFile *pf;
-    Interp *interp;
-    int terse = 0;
-    int disas = 0;
-    int convert = 0;
-    int header = 0;
-    const char *file = NULL;
-    struct longopt_opt_info opt = LONGOPT_OPT_INFO_INIT;
-    int status;
-
-    if (argc < 2) {
-        help();
-    }
-    interp = Parrot_new(NULL);
-    /* init and set top of stack */
-    Parrot_init_stacktop(interp, &status);
-    while ((status = longopt_get(interp,
-                    argc, argv, options, &opt)) > 0) {
-        switch (opt.opt_id) {
-            case 'h':
-                header = 1;
-                break;
-            case 't':
-                terse = 1;
-                break;
-            case 'd':
-                disas = 1;
-                break;
-            case 'o':
-                file = opt.opt_arg;
-                convert = 1;
-                break;
-            case '?':
-            default:
-                help();
-                break;
-        }
-    }
-    if (status == -1) {
-        help();
-    }
-    argc -= opt.opt_index;
-    argv += opt.opt_index;
-
-
-    pf = Parrot_readbc(interp, *argv);
-
-    if (!pf) {
-        printf("Can't read PBC\n");
-        return 1;
-    }
-    Parrot_loadbc(interp, pf);
-    if (convert) {
-        size_t size;
-        opcode_t *pack;
-        FILE *fp;
-
-        size = PackFile_pack_size(interp,
-                interp->code->base.pf) * sizeof (opcode_t);
-        pack = (opcode_t*) mem_sys_allocate(size);
-        if (!pack) {
-            printf("out of mem\n");
-            exit(EXIT_FAILURE);
-        }
-        PackFile_pack(interp, interp->code->base.pf, pack);
-        if (STREQ(file, "-"))
-            fp = stdout;
-        else if ((fp = fopen(file, "wb")) == 0) {
-            printf("Couldn't open %s\n", file);
-            exit(EXIT_FAILURE);
-        }
-
-        if ((1 != fwrite(pack, size, 1, fp))) {
-            printf("Couldn't write %s\n", file);
-            exit(EXIT_FAILURE);
-        }
-        fclose(fp);
-        mem_sys_free(pack);
-        Parrot_exit(interp, 0);
-    }
-
-    PackFile_header_dump(interp, pf);
-    if (header) {
-        Parrot_exit(interp, 0);
-    }
-    /* install a dumper function */
-    if (!terse) {
-        pf->PackFuncs[PF_CONST_SEG].dump = const_dump;
-        pf->PackFuncs[PF_FIXUP_SEG].dump = fixup_dump;
-    }
-    if (disas)
-        pf->PackFuncs[PF_BYTEC_SEG].dump = disas_dump;
-    /* do a directory dump, which dumps segs then */
-    PackFile_Segment_dump(interp, &pf->directory.base);
-
-    Parrot_exit(interp, 0);
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<src/packdump.c>.
-
-=cut
-
-*/
-
-/*
- * Local variables:
- *   c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */

Modified: branches/vtable_morph_change/src/pmc.c
==============================================================================
--- branches/vtable_morph_change/src/pmc.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -589,14 +589,15 @@
         PMC * const item           =
             (PMC *)VTABLE_get_pointer_keyed_str(interp, classname_hash, name);
 
-        /* nested namespace with same name */
-        if (item->vtable->base_type == enum_class_NameSpace)
-            return enum_type_undef;
-
-        if (!PMC_IS_NULL(item))
-            return VTABLE_get_integer(interp, item);
-
-        return Parrot_get_datatype_enum(interp, name);
+        if (!PMC_IS_NULL(item)) {
+            /* nested namespace with same name */
+            if (item->vtable->base_type == enum_class_NameSpace)
+                return enum_type_undef;
+            else
+                return VTABLE_get_integer(interp, item);
+        }
+        else
+            return Parrot_get_datatype_enum(interp, name);
     }
 }
 

Modified: branches/vtable_morph_change/src/pmc/bigint.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/bigint.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/bigint.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -84,7 +84,7 @@
     mpz_set_str(bi->b, value, base);
 }
 
-static BIGNUM*
+static BIGINT*
 bigint_get_self(PARROT_INTERP, PMC *self) {
     BIGINT *bi;
     GETATTR_BigInt_bi(interp, self, bi);
@@ -92,7 +92,7 @@
 }
 
 static void
-bigint_set_self(PARROT_INTERP, PMC *self, BIGNUM *value) {
+bigint_set_self(PARROT_INTERP, PMC *self, BIGINT *value) {
     BIGINT *bi;
     GETATTR_BigInt_bi(interp, self, bi);
     mpz_set(bi->b, (mpz_srcptr)((BIGINT*)value)->b);
@@ -401,12 +401,12 @@
 }
 
 static void
-bigint_set_self(PARROT_INTERP, PMC *self, BIGNUM *value) {
+bigint_set_self(PARROT_INTERP, PMC *self, BIGINT *value) {
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
         "no bigint lib loaded");
 }
 
-static BIGNUM*
+static BIGINT*
 bigint_get_self(PARROT_INTERP, PMC *self) {
     Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
         "no bigint lib loaded");

Copied: branches/vtable_morph_change/src/pmc/bignum.pmc (from r36514, trunk/src/pmc/bignum.pmc)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/vtable_morph_change/src/pmc/bignum.pmc	Tue Feb 10 02:09:33 2009	(r36517, copy of r36514, trunk/src/pmc/bignum.pmc)
@@ -0,0 +1,1450 @@
+/*
+Copyright (C) 2004-2008, The Perl Foundation.
+$Id$
+
+=head1 NAME
+
+src/pmc/bignum.pmc - BigNum PMC class
+
+=head1 DESCRIPTION
+
+C<BigNum> provides arbitrary precision integer mathematic functions.
+
+=head2 Functions
+
+=over 4
+
+=item C<static void bignum_set_long(Interp*, PMC *, long value)>
+
+=item C<static void bignum_set_double(Interp*, PMC *, double value)>
+
+=cut
+
+*/
+
+#include "parrot/parrot.h"
+
+#ifdef S_SPLINT_S
+#  undef PARROT_HAS_GMP /* splint barfs on the gmp.h header */
+#endif /* S_SPLINT_S */
+
+/* Temporariliy disabled until someone fix it */
+#ifdef PARROT_HAS_GMP
+#  undef PARROT_HAS_GMP
+#endif
+
+#ifdef PARROT_HAS_GMP
+#  include <gmp.h>
+typedef struct BIGNUM {
+    mpf_t b;
+} BIGNUM;
+
+#endif
+
+static void
+bignum_init(PARROT_INTERP, PMC *self) {
+    Parrot_BigNum_attributes *attrs =
+        mem_allocate_zeroed_typed(Parrot_BigNum_attributes);
+#ifdef PARROT_HAS_GMP
+    attrs->bi = mem_allocate_zeroed_typed(BIGNUM);
+    mpf_init(attrs->bi->b);
+#else
+    attrs->bi = NULL;
+#endif
+    PMC_data(self) = attrs;
+}
+
+
+static void
+bignum_clear(PARROT_INTERP, PMC *self) {
+#ifdef PARROT_HAS_GMP
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    mpf_clear(bi->b);
+#endif
+}
+
+#ifdef PARROT_HAS_GMP
+
+static void
+bignum_set(PARROT_INTERP, PMC *dest, PMC *src) {
+    BIGNUM *bi_dest, *bi_src;
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    GETATTR_BigNum_bi(interp, src,  bi_src);
+    mpf_clear(bi_dest->b);
+    mpf_init(bi_dest->b);
+    mpf_set(bi_dest->b, bi_src->b);
+}
+
+static void
+bignum_set_long(PARROT_INTERP, PMC *self, long value) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    mpf_set_si(bi->b, value);
+}
+
+static void
+bignum_set_double(PARROT_INTERP, PMC *self, double value) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    mpf_set_d(bi->b, value);
+}
+
+static void
+bignum_set_str(PARROT_INTERP, PMC *self, char *value, int base) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    mpf_set_str(bi->b, value, base);
+}
+
+static BIGNUM*
+bignum_get_self(PARROT_INTERP, PMC *self) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    return bi;
+}
+
+static void
+bignum_set_self(PARROT_INTERP, PMC *self, BIGNUM *value) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    mpf_set(bi->b, (mpf_srcptr)((BIGNUM*)value)->b);
+}
+
+static long
+bignum_get_long(PARROT_INTERP, PMC *self) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    if (mpf_fits_slong_p(bi->b))
+        return mpf_get_si(bi->b);
+
+    Parrot_ex_throw_from_c_args(interp, NULL, 1, "bignum_get_long: number too big");
+}
+
+static int
+bignum_get_bool(PARROT_INTERP, PMC *self) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    if (mpf_sgn(bi->b) != 0)
+        return 1;
+    else
+        return 0;
+}
+
+static char *
+bignum_get_string(PARROT_INTERP, PMC *self, int base) {
+    BIGNUM *bi;
+    size_t  n;
+    char   *s;
+
+    GETATTR_BigNum_bi(interp, self, bi);
+    n = mpf_sizeinbase(bi->b, base) + 2;
+    s = (char *)mem_sys_allocate(n);
+    return mpf_get_str(s, base, bi->b);
+}
+
+static double
+bignum_get_double(PARROT_INTERP, PMC *self) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    return mpf_get_d(bi->b);
+}
+
+static void
+bignum_add_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    BIGNUM *bi_self, *bi_value, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, value, bi_value);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    mpf_add(bi_dest->b, bi_self->b, bi_value->b);
+}
+
+static void
+bignum_add_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    if (value < 0)
+        mpf_sub_ui(bi_dest->b, bi_self->b, (unsigned long int)-value);
+    else
+        mpf_add_ui(bi_dest->b, bi_self->b, (unsigned long int)value);
+}
+
+static void
+bignum_sub_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    BIGNUM *bi_self, *bi_value, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, value, bi_value);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    mpf_sub(bi_dest->b, bi_self->b, bi_value->b);
+}
+
+static void
+bignum_sub_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    if (value < 0)
+        mpf_add_ui(bi_dest->b, bi_self->b, (unsigned long int)-value);
+    else
+        mpf_sub_ui(bi_dest->b, bi_self->b, (unsigned long int)value);
+}
+
+static void
+bignum_mul_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    BIGNUM *bi_self, *bi_value, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, value, bi_value);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    mpf_mul(bi_dest->b, bi_self->b, bi_value->b);
+}
+
+static void
+bignum_mul_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    mpf_mul_si(bi_dest->b, bi_self->b, value);
+}
+
+static void
+bignum_pow_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    mpf_pow_ui(bi_dest->b, bi_self->b, (unsigned long int)value);
+}
+
+static void
+int_check_divide_zero(PARROT_INTERP, INTVAL value) {
+    if (value == 0)
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+}
+
+static void
+bignum_check_divide_zero(PARROT_INTERP, PMC *value) {
+    /* Throw an exception if we are dividing by zero. */
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, value, bi);
+    if (mpf_cmp_si(bi->b, 0) == 0)
+        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_DIV_BY_ZERO,
+            "Divide by zero");
+}
+
+static void
+bignum_div_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    BIGNUM *bi_self, *bi_value, *bi_dest;
+    bignum_check_divide_zero(interp, value);
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, value, bi_value);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    /* this is mpf_fdiv_q */
+    mpf_div(bi_dest->b, bi_self->b, bi_value->b);
+}
+
+static void
+bignum_div_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    int_check_divide_zero(interp, value);
+
+    /* this is mpf_fdiv_q */
+    if (value < 0) {
+        mpf_div_ui(bi_dest->b, bi_self->b, (unsigned long int)-value);
+        mpf_neg(bi_dest->b, bi_dest->b);
+    }
+    else
+        mpf_div_ui(bi_dest->b, bi_self->b, (unsigned long int)value);
+}
+
+static void
+bignum_fdiv_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    BIGNUM *bi_self, *bi_value, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, value, bi_value);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    bignum_check_divide_zero(interp, value);
+    mpf_fdiv_q(bi_dest->b, bi_self->b, bi_value->b);
+}
+
+static void
+bignum_fdiv_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    int_check_divide_zero(interp, value);
+
+    if (value < 0) {
+        mpf_fdiv_q_ui(bi_dest->b, bi_self->b, (unsigned long int)-value);
+        mpf_neg(bi_dest->b, bi_dest->b);
+    }
+    else
+        mpf_fdiv_q_ui(bi_dest->b, bi_self->b, (unsigned long int)value);
+}
+
+static void
+bignum_mod_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    BIGNUM *bi_self, *bi_value, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, value, bi_value);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    bignum_check_divide_zero(interp, value);
+    mpf_mod(bi_dest->b, bi_self->b, bi_value->b);
+}
+
+static void
+bignum_mod_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    int_check_divide_zero(interp, value);
+
+    if (value < 0) {
+        mpf_mod_ui(bi_dest->b, bi_self->b, (unsigned long int)-value);
+    }
+    else
+        mpf_mod_ui(bi_dest->b, bi_self->b, (unsigned long int)value);
+}
+
+static INTVAL
+bignum_cmp(PARROT_INTERP, PMC *self, PMC *value) {
+    BIGNUM *bi_self, *bi_value;
+    GETATTR_BigNum_bi(interp, self,  bi_self);
+    GETATTR_BigNum_bi(interp, value, bi_value);
+    return mpf_cmp(bi_self->b, bi_value->b);
+}
+
+static INTVAL
+bignum_cmp_int(PARROT_INTERP, PMC *self, INTVAL value) {
+    BIGNUM *bi;
+    GETATTR_BigNum_bi(interp, self, bi);
+    return mpf_cmp_si(bi->b, value);
+}
+
+static void
+bignum_abs(PARROT_INTERP, PMC *self, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    VTABLE_morph(interp, dest, enum_class_BigNum);
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    mpf_abs(bi_dest->b, bi_self->b);
+}
+
+static void
+bignum_neg(PARROT_INTERP, PMC *self, PMC *dest) {
+    BIGNUM *bi_self, *bi_dest;
+    VTABLE_morph(interp, dest, enum_class_BigNum);
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    mpf_neg(bi_dest->b, bi_self->b);
+}
+
+static void
+bignum_bitwise_shl_bignum_int(PARROT_INTERP, PMC *self,
+                              INTVAL value, PMC *dest)
+{
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    /* The third args to mpf_mul_2exp and mpf_tdiv_q_2exp are unsigned, so we
+       need to do something sensible with negative values. */
+    if (value >= 0)
+        mpf_mul_2exp(bi_dest->b, bi_self->b, (unsigned long int)value);
+    else
+        mpf_tdiv_q_2exp(bi_dest->b, bi_self->b, (unsigned long int)-value);
+}
+
+static void
+bignum_bitwise_shr_bignum_int(PARROT_INTERP, PMC *self,
+                              INTVAL value, PMC *dest)
+{
+    BIGNUM *bi_self, *bi_dest;
+    GETATTR_BigNum_bi(interp, self, bi_self);
+    GETATTR_BigNum_bi(interp, dest, bi_dest);
+    /* The third args to mpf_mul_2exp and mpf_tdiv_q_2exp are unsigned, so we
+       need to do something sensible with negative values. */
+    if (value >= 0)
+        mpf_tdiv_q_2exp(bi_dest->b, bi_self->b, (unsigned long int)value);
+    else
+        mpf_mul_2exp(bi_dest->b, bi_self->b, (unsigned long int)-value);
+}
+
+#else /* ifdef PARROT_HAS_GMP */
+
+typedef struct BIGNUM {
+    FLOATVAL b; /* bogus definition for users without libgmp*/
+} BIGNUM;
+
+#  if 0
+static void
+bignum_init(PARROT_INTERP, PMC *self) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_clear(PARROT_INTERP, PMC *self) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+#  endif
+
+static void
+bignum_set_long(PARROT_INTERP, PMC *self, long value) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_set(PARROT_INTERP, PMC *dest, PMC *src) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_set_double(PARROT_INTERP, PMC *self, double value) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_set_str(PARROT_INTERP, PMC *self, char *value, int base) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_set_self(PARROT_INTERP, PMC *self, BIGNUM *value) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static BIGNUM*
+bignum_get_self(PARROT_INTERP, PMC *self) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static char *
+bignum_get_string(PARROT_INTERP, PMC *self, int base) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static long
+bignum_get_long(PARROT_INTERP, PMC *self) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static long
+bignum_get_bool(PARROT_INTERP, PMC *self) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static double
+bignum_get_double(PARROT_INTERP, PMC *self) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_add_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_add_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_sub_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_sub_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_mul_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_mul_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_pow_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_div_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_div_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_fdiv_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_fdiv_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_mod_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_mod_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static INTVAL
+bignum_cmp(PARROT_INTERP, PMC *self, PMC *value) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static INTVAL
+bignum_cmp_int(PARROT_INTERP, PMC *self, INTVAL value) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_abs(PARROT_INTERP, PMC *self, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_neg(PARROT_INTERP, PMC *self, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_bitwise_shl_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_bitwise_shl_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest)
+{
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_bitwise_shr_bignum(PARROT_INTERP, PMC *self, PMC *value, PMC *dest) {
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+static void
+bignum_bitwise_shr_bignum_int(PARROT_INTERP, PMC *self, INTVAL value, PMC *dest)
+{
+    Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LIBRARY_ERROR,
+        "no bignum lib loaded");
+}
+
+#endif /* ifdef PARROT_HAS_GMP */
+
+pmclass BigNum {
+    ATTR struct BIGNUM * bi; /*bignum val*/
+
+/*
+
+=back
+
+=head2 Methods
+
+=over 4
+
+=item C<METHOD version()>
+
+Return GMP version string "x.y.z".
+
+=cut
+
+*/
+
+    METHOD version() {
+        STRING *version;
+#ifdef PARROT_HAS_GMP
+        version = Parrot_str_new(INTERP, gmp_version, 0);
+#else
+        version = Parrot_str_new(INTERP, "0.0.0", 5);
+#endif
+        RETURN(STRING *version);
+    }
+
+/*
+
+=item C<PMC *instantiate(PMC *sig)>
+
+Object constructor. SELF is a BigNum Class object. Return a new
+BigNum object.
+
+=cut
+
+*/
+    VTABLE PMC *instantiate(PMC *sig) {
+        return PMCNULL;
+
+        /* TODO -- actually build this thing */
+#if 0
+        int argcP = REG_INT(interp, 3);
+        int base;
+        PMC *res;
+        STRING *num;
+
+        res = pmc_new(INTERP, enum_class_BigNum);
+        if (!argcP) {
+            return res;
+        }
+        base = 10;
+        if (argcP == 2)
+            base = VTABLE_get_integer(INTERP, REG_PMC(interp, 6));
+        num = VTABLE_get_string(INTERP, REG_PMC(interp, 5));
+        VTABLE_set_string_keyed_int(INTERP, res, base, num);
+        return res;
+#endif
+    }
+
+    VTABLE void init() {
+        bignum_init(INTERP, SELF);
+        PObj_active_destroy_SET(SELF);
+    }
+
+    VTABLE PMC *clone() {
+        PMC *res = pmc_new(INTERP, SELF->vtable->base_type);
+        bignum_set(INTERP, res, SELF);
+        return res;
+    }
+
+    VTABLE void destroy() {
+        BIGNUM                   *bi;
+        Parrot_BigNum_attributes *attrs;
+
+        bignum_clear(INTERP, SELF);
+
+        attrs = (Parrot_BigNum_attributes*)PMC_data(SELF);
+#ifdef PARROT_HAS_GMP
+        mem_sys_free(attrs->bi);
+#endif
+        mem_sys_free(attrs);
+    }
+
+/*
+
+=item C<void set_integer_native(INTVAL value)>
+
+=cut
+
+*/
+
+    VTABLE void set_integer_native(INTVAL value) {
+        bignum_set_long(INTERP, SELF, (long)value);
+    }
+
+/*
+
+=item C<void set_number_native(FLOATVAL value)>
+
+Sets the value of the bignum to C<value>.
+
+=cut
+
+*/
+
+    VTABLE void set_number_native(FLOATVAL value) {
+        bignum_set_double(INTERP, SELF, (double)value);
+    }
+
+/*
+
+=item C<void set_string_native(STRING *value)>
+
+Sets the value of the integer to the result of converting C<*value> to a
+number.
+
+=item C<void set_string_keyed_int(INTVAL base, STRING *value)>
+
+Same assume number base C<base>.
+
+=cut
+
+*/
+
+    VTABLE void set_string_native(STRING *value) {
+        char * const s = Parrot_str_to_cstring(INTERP, value);
+        bignum_set_str(INTERP, SELF, s, 10);
+        Parrot_str_free_cstring(s);
+    }
+
+    VTABLE void set_string_keyed_int(INTVAL base, STRING *value) {
+        char * const s = Parrot_str_to_cstring(INTERP, value);
+        bignum_set_str(INTERP, SELF, s, base);
+        Parrot_str_free_cstring(s);
+    }
+/*
+
+=item C<void set_pmc(PMC *value)>
+
+Sets the value of the integer to the integer value of C<*value>.
+
+=cut
+
+*/
+
+    VTABLE void set_pmc(PMC *value) {
+        bignum_set_self(INTERP, SELF, bignum_get_self(INTERP, value));
+    }
+
+/*
+
+=item C<FLOATVAL get_number()>
+
+Returns the value of the integer as a floating point number.
+
+=cut
+
+*/
+
+    VTABLE FLOATVAL get_number() {
+        return bignum_get_double(INTERP, SELF);
+    }
+
+/*
+
+=item C<INTVAL get_integer()>
+
+Returns the value of the integer.
+
+=cut
+
+*/
+
+    VTABLE INTVAL get_integer() {
+        return bignum_get_long(INTERP, SELF);
+    }
+
+/*
+
+=item C<PMC *get_bignum()>
+
+Returns SELF
+
+=cut
+
+*/
+
+    VTABLE PMC *get_bignum() {
+        return SELF;
+    }
+
+/*
+
+=item C<INTVAL get_bool()>
+
+Returns the boolean value of the integer.
+
+=cut
+
+*/
+
+    VTABLE INTVAL get_bool() {
+        return bignum_get_bool(INTERP, SELF);
+    }
+
+/*
+
+=item C<STRING *get_string()>
+
+Returns the string representation of the integer.
+
+=item C<STRING *get_string_keyed_int(INTVAL base)>
+
+Returns the string representation of the integer in base C<base>.
+
+=item C<STRING *get_repr()>
+
+Returns the string representation of the integer with the letter 'L'
+appended.
+
+=cut
+
+*/
+
+    VTABLE STRING *get_string() {
+        char   *s  = bignum_get_string(INTERP, SELF, 10);
+        STRING *ps = Parrot_str_new(INTERP, s, 0);
+        mem_sys_free(s);
+        return ps;
+    }
+
+    VTABLE STRING *get_string_keyed_int(INTVAL base) {
+        char   *s  = bignum_get_string(INTERP, SELF, base);
+        STRING *ps = Parrot_str_new(INTERP, s, 0);
+        mem_sys_free(s);
+        return ps;
+    }
+
+    VTABLE STRING *get_repr() {
+        STRING *s = SELF.get_string();
+        return Parrot_str_append(INTERP, s, Parrot_str_new(interp, "L", 1));
+    }
+/*
+
+=item C<void increment()>
+
+Increments the integer.
+
+=cut
+
+*/
+
+    VTABLE void increment() {
+        bignum_add_bignum_int(INTERP, SELF, 1, SELF);
+    }
+
+/*
+
+=item C<void decrement()>
+
+Decrements the integer.
+
+=cut
+
+*/
+
+    VTABLE void decrement() {
+        bignum_sub_bignum_int(INTERP, SELF, 1, SELF);
+    }
+
+    MULTI PMC *add(BigNum value, PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_add_bignum(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI PMC *add(Integer value, PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_add_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+        return dest;
+    }
+
+    MULTI PMC *add(DEFAULT value, PMC *dest) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'add' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE PMC *add_int(INTVAL value, PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_add_bignum_int(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI void i_add(BigNum value) {
+        bignum_add_bignum(INTERP, SELF, value, SELF);
+    }
+
+    MULTI void i_add(Integer value) {
+        bignum_add_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+    }
+
+    MULTI void i_add(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_add' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE void i_add_int(INTVAL value) {
+        bignum_add_bignum_int(INTERP, SELF, value, SELF);
+    }
+
+    VTABLE void i_add_float(FLOATVAL value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_add_float' for FLOATVAL");
+    }
+
+
+    MULTI PMC *subtract(BigNum value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_sub_bignum(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI PMC *subtract(Integer value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_sub_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+        return dest;
+    }
+
+    MULTI PMC *subtract(DEFAULT value, PMC *dest) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'subtract' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE PMC *subtract_int(INTVAL value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_sub_bignum_int(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI void i_subtract(BigNum value) {
+        bignum_sub_bignum(INTERP, SELF, value, SELF);
+    }
+
+    MULTI void i_subtract(Integer value) {
+        bignum_sub_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+    }
+
+    MULTI void i_subtract(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_subtract' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE void i_subtract_int(INTVAL value) {
+        bignum_sub_bignum_int(INTERP, SELF, value, SELF);
+    }
+
+    VTABLE void i_subtract_float(FLOATVAL value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_subtract_float' for FLOATVAL");
+    }
+
+
+    MULTI PMC *multiply(BigNum value, PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_mul_bignum(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI PMC *multiply(Integer value, PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_mul_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+        return dest;
+    }
+
+    MULTI PMC *multiply(DEFAULT value, PMC *dest) {
+         Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'multiply' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE PMC *multiply_int(INTVAL value, PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_mul_bignum_int(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI void i_multiply(BigNum value) {
+        bignum_mul_bignum(INTERP, SELF, value, SELF);
+    }
+    MULTI void i_multiply(Integer value) {
+        bignum_mul_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+    }
+    MULTI void i_multiply(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_multiply' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE void i_multiply_int(INTVAL value) {
+        bignum_mul_bignum_int(INTERP, SELF, value, SELF);
+    }
+
+    VTABLE void i_multiply_float(FLOATVAL value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_multiply_float' for FLOATVAL");
+    }
+
+    VTABLE PMC *pow_int(INTVAL value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_pow_bignum_int(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI PMC *pow(PMC *value, PMC *dest) {
+        /* XXX only Integer RHS currently */
+        INTVAL r = VTABLE_get_integer(INTERP, value);
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_pow_bignum_int(INTERP, SELF, r, dest);
+        return dest;
+    }
+
+    MULTI PMC *divide(BigNum value, PMC *dest) {
+        BIGNUM *bi;
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_div_bignum(INTERP, SELF, value, dest);
+#if 0
+        /* to downgrade or not that's the question */
+        GETATTR_BigNum_bi(interp, dest, bi);
+        if (mpf_fits_slong_p(bi->b)) {
+            long iresult = mpf_get_si(bi->b);
+            VTABLE_morph(interp, dest, enum_class_Integer);
+            VTABLE_set_integer_native(interp, dest, iresult);
+        }
+#endif
+        return dest;
+    }
+
+    MULTI PMC *divide(Integer value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_div_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+        return dest;
+    }
+
+    MULTI PMC *divide(DEFAULT value, PMC *dest) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'divide' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE PMC *divide_int(INTVAL value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_div_bignum_int(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI void i_divide(BigNum value) {
+        bignum_div_bignum(INTERP, SELF, value, SELF);
+    }
+    MULTI void i_divide(Integer value) {
+        bignum_div_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+    }
+    MULTI void i_divide(DEFAULT value) {
+         Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_divide' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE void i_divide_int(INTVAL value) {
+        bignum_div_bignum_int(INTERP, SELF, value, SELF);
+    }
+
+    MULTI PMC *floor_divide(BigNum value, PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_fdiv_bignum(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI PMC *floor_divide(Integer value, PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_fdiv_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+        return dest;
+    }
+
+    MULTI PMC *floor_divide(DEFAULT value, PMC *dest) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'floor_divide' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE PMC *floor_divide_int(INTVAL value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_fdiv_bignum_int(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI void i_floor_divide(BigNum value) {
+        bignum_fdiv_bignum(INTERP, SELF, value, SELF);
+    }
+
+    MULTI void i_floor_divide(Integer value) {
+        bignum_fdiv_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+    }
+
+    MULTI void i_floor_divide(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_floor_divide' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE void i_floor_divide_int(INTVAL value) {
+        bignum_fdiv_bignum_int(INTERP, SELF, value, SELF);
+    }
+
+    MULTI PMC *modulus(BigNum value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_mod_bignum(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+    MULTI PMC *modulus(Integer value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_mod_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest);
+        return dest;
+    }
+
+    MULTI PMC *modulus(DEFAULT value, PMC *dest) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'modulus' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    MULTI void i_modulus(BigNum value) {
+        bignum_mod_bignum(INTERP, SELF, value, SELF);
+    }
+    MULTI void i_modulus(Integer value) {
+        bignum_mod_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), SELF);
+    }
+    MULTI void i_modulus(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_modulus' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    MULTI INTVAL cmp(BigNum value) {
+        return bignum_cmp(INTERP, SELF, value);
+    }
+
+    MULTI INTVAL cmp(Integer value) {
+        return bignum_cmp_int(INTERP, SELF, VTABLE_get_integer(interp, value));
+    }
+
+    MULTI INTVAL cmp(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'cmp' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    MULTI INTVAL is_equal(BigNum value) {
+        return bignum_cmp(INTERP, SELF, value) == 0;
+    }
+
+    MULTI INTVAL is_equal(Integer value) {
+        return bignum_cmp_int(INTERP, SELF, VTABLE_get_integer(interp, value)) == 0;
+    }
+
+    MULTI INTVAL is_equal(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'is_equal' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+/*
+
+=item C<PMC *absolute(PMC *dest)>
+
+=item C<void i_absolute()>
+
+Sets C<dest> to the absolute value of SELF.
+
+=cut
+
+*/
+
+    VTABLE PMC *absolute(PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_abs(INTERP, SELF, dest);
+        return dest;
+    }
+
+    VTABLE void i_absolute() {
+        bignum_abs(INTERP, SELF, SELF);
+    }
+
+
+/*
+
+=item C<PMC *neg(PMC *dest)>
+
+=item C<void i_neg()>
+
+Set C<dest> to the negated value of C<SELF>.
+
+=cut
+
+*/
+
+    VTABLE PMC *neg(PMC *dest) {
+        dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_neg(INTERP, SELF, dest);
+        return dest;
+    }
+
+    VTABLE void i_neg() {
+        bignum_neg(INTERP, SELF, SELF);
+    }
+
+/*
+
+=item C<PMC *bitwise_shl(PMC *value, PMC *dest)>
+
+=item C<PMC *bitwise_shl_int(INTVAL value, PMC *dest)>
+
+Returns in C<*dest> the shift left of the BigNum by C<*value>.
+
+=item C<void i_bitwise_shl(PMC *value)>
+
+=item C<void i_bitwise_shl_int(INTVAL value)>
+
+Inplace shift left.
+
+=cut
+
+*/
+
+    MULTI PMC *bitwise_shl(BigNum value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_bitwise_shl_bignum_int(INTERP, SELF,
+                                      VTABLE_get_integer(INTERP, value),
+                                      dest);
+        return dest;
+    }
+
+    MULTI PMC *bitwise_shl(Integer value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_bitwise_shl_bignum_int(INTERP, SELF,
+                VTABLE_get_integer(interp, value), dest);
+        return dest;
+    }
+    MULTI PMC *bitwise_shl(DEFAULT value, PMC *dest) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'bitwise_shl' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE PMC *bitwise_shl_int(INTVAL value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_bitwise_shl_bignum_int(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+
+    MULTI void i_bitwise_shl(BigNum value) {
+        bignum_bitwise_shl_bignum_int(INTERP, SELF,
+                                      VTABLE_get_integer(INTERP, value),
+                                      SELF);
+    }
+
+    MULTI void i_bitwise_shl(Integer value) {
+        bignum_bitwise_shl_bignum_int(INTERP, SELF,
+                VTABLE_get_integer(interp, value), SELF);
+    }
+
+    MULTI void i_bitwise_shl(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_bitwise_shl' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE void i_bitwise_shl_int(INTVAL value) {
+        bignum_bitwise_shl_bignum_int(INTERP, SELF, value, SELF);
+    }
+
+/*
+
+=item C<PMC *bitwise_shr(PMC *value, PMC *dest)>
+
+=item C<PMC *bitwise_shr_int(INTVAL value, PMC *dest)>
+
+Returns in C<*dest> the shift right of the BigNum by C<*value>.
+
+=item C<void i_bitwise_shr(PMC *value)>
+
+=item C<void i_bitwise_shr_int(INTVAL value)>
+
+Inplace shift left.
+
+=cut
+
+*/
+
+    MULTI PMC *bitwise_shr(BigNum value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_bitwise_shr_bignum_int(INTERP, SELF,
+                                      VTABLE_get_integer(INTERP, value),
+                                      dest);
+        return dest;
+    }
+
+    MULTI PMC *bitwise_shr(Integer value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_bitwise_shr_bignum_int(INTERP, SELF,
+                VTABLE_get_integer(interp, value), dest);
+        return dest;
+    }
+
+    MULTI PMC *bitwise_shr(DEFAULT value, PMC *dest) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'bitwise_shr' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE PMC *bitwise_shr_int(INTVAL value, PMC *dest) {
+        if (dest)
+            VTABLE_morph(interp, dest, SELF->vtable->base_type);
+        else
+            dest = pmc_new(INTERP, SELF->vtable->base_type);
+
+        bignum_bitwise_shr_bignum_int(INTERP, SELF, value, dest);
+        return dest;
+    }
+
+
+    MULTI void i_bitwise_shr(BigNum value) {
+        bignum_bitwise_shr_bignum_int(INTERP, SELF,
+                                      VTABLE_get_integer(INTERP, value),
+                                      SELF);
+    }
+
+    MULTI void i_bitwise_shr(Integer value) {
+        bignum_bitwise_shr_bignum_int(INTERP, SELF,
+                VTABLE_get_integer(interp, value), SELF);
+    }
+
+    MULTI void i_bitwise_shr(DEFAULT value) {
+        Parrot_ex_throw_from_c_args(INTERP, NULL,
+            EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+            "BigNum: no multiple dispatch variant 'i_bitwise_shr' for %Ss",
+            VTABLE_name(interp, value));
+    }
+
+    VTABLE void i_bitwise_shr_int(INTVAL value) {
+        bignum_bitwise_shr_bignum_int(INTERP, SELF, value, SELF);
+    }
+}
+
+/*
+
+=back
+
+=cut
+
+*/
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Modified: branches/vtable_morph_change/src/pmc/class.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/class.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/class.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -479,7 +479,7 @@
     }
 
     VTABLE void init_pmc(PMC *init_data) {
-        PMC           *arg, *ns_name;
+        PMC           *arg;
         const INTVAL   arg_type = VTABLE_type(interp, init_data);
         STRING * const name_str = CONST_STRING(interp, "name");
 
@@ -1149,7 +1149,6 @@
 
     VTABLE PMC *instantiate(PMC *init) {
         Parrot_Class_attributes  * const _class    = PARROT_CLASS(SELF);
-        STRING                   * const class_str = CONST_STRING(interp, "Class");
 
         Parrot_Object_attributes *obj_guts;
         PMC                      *object;
@@ -1158,7 +1157,7 @@
         if (!_class->instantiated) {
             /* Check that we have all methods listed in resolve list. */
             const int resolve_count = VTABLE_elements(interp, _class->resolve_method);
-            INTVAL    cur_hll       = CONTEXT(interp)->current_HLL;
+            const INTVAL cur_hll    = CONTEXT(interp)->current_HLL;
             INTVAL    mro_length;
             int       i;
 
@@ -1325,8 +1324,7 @@
 */
 
     VTABLE INTVAL isa(STRING *classname) {
-        Parrot_Class_attributes * const _class = PARROT_CLASS(SELF);
-        PMC                            *want_class;
+        PMC *want_class;
 
         /* hard-code this one exception right away */
         if (Parrot_str_not_equal(interp, classname, CONST_STRING(interp, "Class")) == 0)

Modified: branches/vtable_morph_change/src/pmc/coroutine.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/coroutine.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/coroutine.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -37,7 +37,9 @@
 print_sub_name(PARROT_INTERP, PMC *sub)
 {
     Parrot_coro * const co     = PMC_coro(sub);
-    Interp      * const tracer = interp->debugger ? interp->debugger : interp;
+    Interp      * const tracer = (interp->pdb && interp->pdb->debugger) ?
+        interp->pdb->debugger :
+        interp;
 
     Parrot_io_eprintf(tracer, "# %s coro '%Ss'",
         !(PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF) ?

Modified: branches/vtable_morph_change/src/pmc/exceptionhandler.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/exceptionhandler.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/exceptionhandler.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -137,7 +137,7 @@
 */
 
     VTABLE INTVAL get_integer() {
-        Parrot_cont * const cc = PMC_cont(SELF);
+        const Parrot_cont * const cc = PMC_cont(SELF);
         return cc->invoked;
     }
 
@@ -152,10 +152,8 @@
 */
 
     VTABLE opcode_t *invoke(void *next) {
-        Parrot_cont      *cc           = PMC_cont(SELF);
-        Parrot_Context   *from_ctx     = CONTEXT(interp);
-        Parrot_Context   *to_ctx       = cc->to_ctx;
-        opcode_t         *pc           = cc->address;
+        Parrot_cont * const cc = PMC_cont(SELF);
+        opcode_t    * const pc = cc->address;
 
         Parrot_continuation_check(interp, SELF, cc);
         Parrot_continuation_rewind_environment(interp, SELF, cc);
@@ -200,6 +198,8 @@
 
         if (exception->vtable->base_type == enum_class_Exception
         ||  VTABLE_isa(INTERP, exception, ex_str)) {
+            PMC * handled_types;
+            GET_ATTR_handled_types(INTERP, SELF, handled_types);
 
             if (severity < core_struct->min_severity) {
                 RETURN(INTVAL 0);
@@ -208,14 +208,14 @@
                  &&  severity                  > core_struct->max_severity) {
                 RETURN(INTVAL 0);
             }
-            if (core_struct->handled_types != PMCNULL) {
-                INTVAL elems = VTABLE_elements(interp, core_struct->handled_types);
-                INTVAL type  = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "type"));
+            if (! PMC_IS_NULL(handled_types)) {
+                const INTVAL elems = VTABLE_elements(interp, handled_types);
+                const INTVAL type  = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "type"));
                 INTVAL i;
 
                 for (i = 0; i < elems; i++) {
                     INTVAL handled_type = VTABLE_get_integer_keyed_int(interp,
-                            core_struct->handled_types, i);
+                            handled_types, i);
                     if (handled_type == type)
                         RETURN(INTVAL 1);
                 }
@@ -223,12 +223,12 @@
                 RETURN(INTVAL 0);
             }
             if (core_struct->handled_types_except != PMCNULL) {
-                INTVAL elems = VTABLE_elements(interp, core_struct->handled_types_except);
-                INTVAL type  = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "type"));
+                const INTVAL elems = VTABLE_elements(interp, core_struct->handled_types_except);
+                const INTVAL type  = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "type"));
                 INTVAL i;
 
                 for (i = 0; i < elems; i++) {
-                    INTVAL handled_type = VTABLE_get_integer_keyed_int(interp,
+                    const INTVAL handled_type = VTABLE_get_integer_keyed_int(interp,
                             core_struct->handled_types_except, i);
                     if (handled_type == type)
                         RETURN(INTVAL 0);

Modified: branches/vtable_morph_change/src/pmc/multisub.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/multisub.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/multisub.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -81,14 +81,14 @@
        ResizablePMCArray's VTABLE methods of the same names. Hopefully we
        don't need anything beyond that. */
     VTABLE PMC *get_pmc_keyed(PMC *key) {
-        PMC *sub = Parrot_mmd_sort_manhattan(INTERP, SELF);
+        PMC * const sub = Parrot_mmd_sort_manhattan(INTERP, SELF);
         if (PMC_IS_NULL(sub))
             Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable methods.\n");
         return SUPER(key);
     }
 
     VTABLE PMC *get_pmc_keyed_string(STRING *s) {
-        PMC *sub = Parrot_mmd_sort_manhattan(INTERP, SELF);
+        PMC * const sub = Parrot_mmd_sort_manhattan(INTERP, SELF);
         if (PMC_IS_NULL(sub))
             Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable methods.\n");
         return SUPER(s);

Modified: branches/vtable_morph_change/src/pmc/namespace.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/namespace.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/namespace.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -447,13 +447,14 @@
     VTABLE void *get_pointer_keyed_str(STRING *key) {
         PMC *ns = (PMC *)parrot_hash_get(INTERP, NS_HASH(SELF), key);
 
+        /* Be extra carefull about returnning PMCNULL */
+        if (! PMC_IS_NULL(ns)) {
+            if ((PObj_get_FLAGS(ns) & FPA_is_ns_ext) &&
+                    ns->vtable->base_type == enum_class_FixedPMCArray)
+                ns = VTABLE_get_pmc_keyed_int(INTERP, ns, NS_slot_var_sub);
+        }
         if (PMC_IS_NULL(ns))
-            return PMCNULL;
-
-        if ((PObj_get_FLAGS(ns) & FPA_is_ns_ext) &&
-                ns->vtable->base_type == enum_class_FixedPMCArray)
-            ns = VTABLE_get_pmc_keyed_int(INTERP, ns, NS_slot_var_sub);
-
+            ns = PMCNULL;
         return ns;
     }
 

Modified: branches/vtable_morph_change/src/pmc/object.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/object.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/object.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, The Perl Foundation.
+Copyright (C) 2001-2009, The Perl Foundation.
 $Id$
 
 =head1 NAME
@@ -28,14 +28,14 @@
 get_attrib_index(PARROT_INTERP, PMC *self, STRING *name)
 {
     Parrot_Class_attributes * const _class  = PARROT_CLASS(self);
-    INTVAL                          cur_hll = CONTEXT(interp)->current_HLL;
+    const INTVAL                    cur_hll = CONTEXT(interp)->current_HLL;
     int                             num_classes, i;
 
     CONTEXT(interp)->current_HLL = 0;
 
     /* First see if we can find it in the cache. */
     if (VTABLE_exists_keyed_str(interp, _class->attrib_cache, name)) {
-        INTVAL retval =
+        const INTVAL retval =
             VTABLE_get_integer_keyed_str(interp, _class->attrib_cache, name);
         CONTEXT(interp)->current_HLL = cur_hll;
         return retval;
@@ -266,7 +266,7 @@
 */
     VTABLE void set_attr_str(STRING *name, PMC *value) {
         Parrot_Object_attributes * const obj       = PARROT_OBJECT(SELF);
-        STRING        *vtable_meth_name = CONST_STRING(interp, "set_attr_str");
+        STRING        * const vtable_meth_name = CONST_STRING(interp, "set_attr_str");
         INTVAL         index;
 
         /* If there's a vtable override for 'set_attr_str' run that first. */

Modified: branches/vtable_morph_change/src/pmc/pmc.num
==============================================================================
--- branches/vtable_morph_change/src/pmc/pmc.num	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/pmc.num	Tue Feb 10 02:09:33 2009	(r36517)
@@ -45,12 +45,12 @@
 float.pmc    28
 integer.pmc    29
 bigint.pmc    30
-complex.pmc    31
-string.pmc    32
+bignum.pmc    31
+complex.pmc    32
+string.pmc    33
 
 # abstract perlscalar.pmc
-perlint.pmc    33
-perlnum.pmc    34
+perlint.pmc    34
 perlstring.pmc    35
 perlundef.pmc    36
 boolean.pmc    37

Modified: branches/vtable_morph_change/src/pmc/string.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/string.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/string.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -135,7 +135,7 @@
 
     VTABLE PMC *get_bignum() {
         STRING * const s   = SELF.get_string();
-        PMC           *ret = pmc_new(INTERP, enum_class_BigInt);
+        PMC    * const ret = pmc_new(INTERP, enum_class_BigInt);
         VTABLE_set_string_native(INTERP, ret, s);
         return ret;
     }

Modified: branches/vtable_morph_change/src/pmc/stringhandle.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/stringhandle.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/stringhandle.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -157,7 +157,7 @@
 
     METHOD open(STRING *filename :optional, INTVAL got_filename :opt_flag,
                 STRING *mode :optional, INTVAL got_mode :opt_flag) {
-        STRING *open_mode, *old_string, *new_string, *encoding;
+        STRING *open_mode, *old_string;
         INTVAL flags;
 
         if (got_mode && !STRING_IS_NULL(mode))
@@ -170,6 +170,9 @@
         /* If StringHandle hasn't already been initialized, create a new string. */
         GET_ATTR_stringhandle(INTERP, SELF, old_string);
         if (STRING_IS_NULL(old_string)) {
+            STRING *new_string;
+            STRING *encoding;
+
             GET_ATTR_encoding(INTERP, SELF, encoding);
             if (!STRING_IS_NULL(encoding)
             &&  Parrot_str_not_equal(INTERP, encoding, CONST_STRING(INTERP, "utf8")) == 0)
@@ -377,7 +380,7 @@
 */
 
     METHOD print(PMC *to_print) {
-        STRING *string_to_print = VTABLE_get_string(INTERP, to_print);
+        STRING * const string_to_print = VTABLE_get_string(INTERP, to_print);
 
         Parrot_io_putps(interp, SELF, string_to_print);
     }
@@ -427,9 +430,9 @@
 
     METHOD buffer_type(STRING *new_type :optional, INTVAL got_type :opt_flag) {
         INTVAL flags;
-        STRING *nobuffer_string   = Parrot_str_new_constant(INTERP, "unbuffered");
-        STRING *linebuffer_string = Parrot_str_new_constant(INTERP, "line-buffered");
-        STRING *fullbuffer_string = Parrot_str_new_constant(INTERP, "full-buffered");
+        STRING * const nobuffer_string   = Parrot_str_new_constant(INTERP, "unbuffered");
+        STRING * const linebuffer_string = Parrot_str_new_constant(INTERP, "line-buffered");
+        STRING * const fullbuffer_string = Parrot_str_new_constant(INTERP, "full-buffered");
 
         GET_ATTR_flags(INTERP, SELF, flags);
 

Modified: branches/vtable_morph_change/src/pmc/sub.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/sub.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/sub.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -25,7 +25,9 @@
 static void
 print_sub_name(PARROT_INTERP, PMC *sub)
 {
-    Interp * const tracer = interp->debugger ? interp->debugger : interp;
+    Interp * const tracer = (interp->pdb && interp->pdb->debugger) ?
+        interp->pdb->debugger :
+        interp;
 
     /* sub was located via globals */
     Parrot_io_eprintf(tracer, "# Calling sub '%Ss'\n# ",

Modified: branches/vtable_morph_change/src/pmc/undef.pmc
==============================================================================
--- branches/vtable_morph_change/src/pmc/undef.pmc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/pmc/undef.pmc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -57,7 +57,7 @@
 
     VTABLE void assign_pmc(PMC *other) {
         if (!PObj_is_object_TEST(other))
-            pmc_reuse(INTERP, SELF, other->vtable->type, 0);
+            pmc_reuse(INTERP, SELF, other->vtable->base_type, 0);
 
         /* don't want to call set_pmc if we're assigning an Undef to an Undef */
         if (other->vtable->base_type != enum_class_Undef)

Modified: branches/vtable_morph_change/src/runops_cores.c
==============================================================================
--- branches/vtable_morph_change/src/runops_cores.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/runops_cores.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -2,14 +2,231 @@
 Copyright (C) 2001-2008, The Perl Foundation.
 $Id$
 
-=head1 NAME
+=head1 Run Cores
 
-src/runops_cores.c - Run Loops
+During execution, the runcore is like the heart of Parrot. The runcore
+controls calling the various opcodes with the correct data, and making
+sure that program flow moves properly. Some runcores, such as the
+I<precomputed C goto runcore> are optimized for speed and don't perform
+many tasks beyond finding and dispatching opcodes. Other runcores,
+such as the I<GC-Debug>, I<debug> and I<profiling> runcores help with
+typical software maintenance and analysis tasks. We'll talk about all
+of these throughout the chapter.
+
+Runcores must pass execution to each opcode in the incoming bytecode
+stream. This is called I<dispatching> the opcodes. Because the different
+runcores are structured in different ways, the opcodes themselves must
+be formated differently. The opcode compiler compiles opcodes into a
+number of separate formats, depending on what runcores are included in
+the compiled Parrot. Because of this, understanding opcodes first
+requires an understanding of the Parrot runcores.
+
+Parrot has multiple runcores. Some are useful for particular maintenance
+tasks, some are only available as optimizations in certain compilers,
+some are intended for general use, and some are just interesing flights
+of fancy with no practical benefits. Here we list the various runcores,
+their uses, and their benefits.
+
+=head2 Slow Core
+
+The slow core is a basic runcore design that treats each opcode as a
+separate function at the C level. Each function is called, and returns
+the address of the next opcode to be called by the core. The slow core
+performs bounds checking to ensure that the next opcode to be called is
+properly in bounds, and not somewhere random in memory. Because of this
+modular approach where opcodes are treated as separate executable
+entities many other runcores, especially diagnostic and maintenance
+cores are based on this design. The program counter C<pc> is the current
+index into the bytecode stream. Here is a pseudocode representation for
+how the slow core works:
+
+  while(1) {
+      pc = NEXT_OPCODE;
+      if(pc < LOW_BOUND || pc > HIGH_BOUND)
+          throw exception;
+      DISPATCH_OPCODE(pc);
+      UPDATE_INTERPRETER();
+  }
+
+=head2 Fast Core
+
+The fast core is a bare-bones core that doesn't do any of the
+bounds-checking or context updating that the slow core does. The fast
+core is the way Parrot should run, and is used to find and debug places
+where execution strays outside of its normal bounds. In pseudocode, the
+fast core is very much like the slow core except it doesn't do the bounds
+checking between each instruction, and doesn't update the interpreter's
+current context for each dispatch.
+
+  while(1) {
+      pc = NEXT_OPCODE;
+      DISPATCH_OPCODE(pc);
+  }
+
+=head2 Switch Core
+
+As its name implies, the switch core uses a gigantic C C<switch / case>
+structure to execute opcodes. Here's a brief example of how this
+architecture works:
+
+  for( ; ; current_opcode++) {
+      switch(*current_opcode) {
+          case opcode_1:
+              ...
+          case opcode_2:
+              ...
+          case opcode_3:
+              ...
+      }
+  }
+
+This is quite a fast architecture for dispatching opcodes because it all
+happens within a single function. The only operations performed between
+opcodes is a jump back to the top of the loop, incrementing the opcode
+pointer, dereferencing the opcode pointer, and then a jump to the C<case>
+statement for the next opcode.
+
+=head2 Computed Goto Core
+
+I<Computed Goto> is a feature of some C compilers where a label is
+treated as a piece of data that can be stored as a C<void *> pointer. Each
+opcode becomes simply a label in a very large function, and pointers to the
+labels are stored in a large array. Calling an opcode is as easy as taking
+that opcode's number as the index of the label array, and calling the
+associated label. Sound complicated? It is a little, especially to C
+programmers who are not used to using labels, much less treating them as
+first class data items.
+
+Notice that computed goto is a feature only available in some compilers
+such as GCC, and will not be available in every distribution of Parrot,
+depending what compilers were used to build it.
+
+As was mentioned earlier, not all compilers support computed goto, which
+means that this core will not be built on platforms that don't support it.
+However, it's still an interesting topic to study so we will look at it
+briefly here. For compilers that support it, computed goto labels are
+C<void **> values. In the computed goto core, all the labels represent
+different opcodes, so they are stored in an array:
+
+  void *my_labels[] = {
+      &&label1,
+      &&label2,
+      &&label3
+  };
+
+  label1:
+      ...
+  label2:
+      ...
+  label3:
+      ...
+
+Jumping to one of these labels is done with a command like this:
+
+  goto *my_labels[opcode_number];
+
+Actually, opcodes are pointed to by an C<opcode_t *> pointer, and all
+opcodes are stored sequentially in memory, so the actual jump in the
+computed goto core must increment the pointer and then jump to the new
+version. In C it looks something like this:
+
+  goto *my_labels[*(current_opcode += 1)];
+
+Each opcode is an index into the array of labels, and at the end of each
+opcode an instruction like this is performed to move to the next opcode
+in series, or else some kind of control flow occurs that moves it to a
+non-sequential location:
+
+  goto *my_lables[*(current_opcode = destination)];
+
+These are simplifications on what really happens in this core, because
+the actual code has been optimized quite a bit from what has been
+presented here. However, as we shall see with the precomputed goto core,
+it isn't optimized as aggressively as is possible.
+
+=head2 Precomputed Goto Core
+
+The precomputed goto core is an amazingly fast optimized core that uses
+the same computed goto feature, but performs the array dereferencing
+before the core even starts. The compiled bytecode is fed into a
+preprocessor that converts the bytecode instruction numbers into lable
+pointer values. In the computed goto core, you have this
+operation to move to the next opcode:
+
+  goto *my_labels[*(current_opcode += 1)];
+
+This single line of code is deceptively complex. A number of machine code
+operations must be performed to complete this step: The value of
+C<current_opcode> must be incremented to the next value, that value must
+be dereferenced to find the opcode value. In C, arrays are pointers, so
+C<my_labels> gets dereferenced and an offset is taken from it to find
+the stored label reference. That label reference is then dereferenced, and
+the jump is performed.
+
+That's a lot of steps to execute before we can jump to the next opcode.
+What if each opcode value was replaced with the value of the jump
+label beforehand? If C<current_opcode> points to a label pointer directly,
+we don't need to perform an additional dereference on the array at all. We
+can replace that entire mess above with this line:
+
+  goto **(current_opcode += 1);
+
+That's far fewer machine instructions to execute before we can move to the
+next opcode, which means faster throughput. Remember that whatever dispatch
+mechanism is used will be called after every single opcode, and some large
+programs may have millions of opcodes! Every single machine instruction
+that can be cut out of the dispatch mechanism could increase the execution
+speed of Parrot in a significant and noticable way. N<The dispatch mechanism
+used by the various runcores is hardly the largest performance bottleneck in
+Parrot anyway, but we like to use faster cores to shave every little bit of
+speed out of the system>.
+
+The caveat of course is that the predereferenced computed goto core is only
+available with compilers that support computed goto, such as GCC. Parrot
+will not have access to this core if it is built with a different compiler.
+
+=head2 Tracing Core
+
+=head2 Profiling Core
+
+The profiling core analyzes the performance of Parrot, and helps to
+determine where bottlenecks and trouble spots are in the programs that
+run on top of Parrot. When Parrot calls a PIR subroutine it sets up the
+environment, allocates storage for the passed parameters and the return
+values, passes the parameters, and calls a new runcore to execute it. To
+calculate the amount of time that each subroutine takes, we need to
+measure the amount of time spent in each runcore from the time the core
+begins to the time the core executes. The profiling core does exactly
+this, acting very similarly to a slow core but also measuring the amount
+of time it takes for the core to complete. The tracing core actually
+keeps track of a few additional values, including the number of GC cycles
+run while in the subroutine, the number of each opcode called and the
+number of calls to each subroutine made. All this information is helpfully
+printed to the STDERR output for later analysis.
+
+=head2 GC Debug Core
+
+Parrot's garbage collector has been known as a weakness in the system
+for several years. In fact, the garbage collector and memory management
+subsystem was one of the last systems to be improved and rewritten before
+the release of version 1.0. It's not that garbage collection isn't
+important, but instead that it was so hard to do earlier in the project.
+
+Early on when the GC was such a weakness, and later when the GC was under
+active development, it was useful to have an operational mode that would
+really exercise the GC and find bugs that otherwise could hide by sheer
+chance. The GC debug runcore was this tool. The core executes a complete
+collection iteration between every single opcode. The throughput
+performance is terrible, but that's not the point: it's almost guaranteed
+to find problems in the memory system if they exist.
+
+=head2 Debug Core
+
+The debug core works like a normal software debugger, such as GDB. The
+debug core executes each opcode, and then prompts the user to enter a
+command. These commands can be used to continue execution, step to the
+next opcode, or examine and manipulate data from the executing program.
 
-=head1 DESCRIPTION
-
-This file implements the various run loops for the interpreter.  See
-F<docs/running.pod> for a fuller description of the runcores and what they do.
 
 =head2 Functions
 
@@ -135,19 +352,26 @@
 
     dod = arena_base->dod_runs;
     gc = arena_base->collect_runs;
-    if (!interp->debugger) {
+    if (interp->pdb) {
+        debugger = interp->pdb->debugger;
+        PARROT_ASSERT(debugger);
+    }
+    else {
         PMC *pio;
 
-        debugger = interp->debugger =
-            /*
-             * using a distinct interpreter for tracing should be ok
-             * - just in case, make it easy to switch
-             */
-#if 1
-            make_interpreter(interp, 0);
+        /*
+         * using a distinct interpreter for tracing should be ok
+         * - just in case, make it easy to switch
+         */
+#if 0
+        debugger = interp:
 #else
-            interp;
+        Parrot_debugger_init(interp);
+        PARROT_ASSERT(interp->pdb);
+        debugger = interp->pdb->debugger;
 #endif
+        PARROT_ASSERT(debugger);
+
         /* set the top of the stack so GC can trace it for GC-able pointers
          * see trace_system_areas() in src/cpu_dep.c */
         debugger->lo_var_ptr = interp->lo_var_ptr;
@@ -162,8 +386,6 @@
             Parrot_io_setbuf(debugger, pio, 8192);
         }
     }
-    else
-        debugger = interp->debugger;
 
     trace_op(interp, code_start, code_end, pc);
     while (pc) {
@@ -354,7 +576,7 @@
                     interp->code->base.data,
                     interp->code->base.data +
                     interp->code->base.size,
-                    interp->pdb->cur_opcode);
+                    pc);
         }
 
         CONTEXT(interp)->current_pc = pc;

Modified: branches/vtable_morph_change/src/scheduler.c
==============================================================================
--- branches/vtable_morph_change/src/scheduler.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/scheduler.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -834,11 +834,40 @@
 Parrot_cx_find_handler_local(PARROT_INTERP, ARGIN(PMC *task))
 {
     ASSERT_ARGS(Parrot_cx_find_handler_local)
+
+    /*
+     * Quick&dirty way to avoid infinite recursion
+     * when an exception is thrown while looking
+     * for a handler
+     */
+    static int already_doing = 0;
+    static Parrot_Context * keep_context = NULL;
+
     Parrot_Context *context;
     PMC            *iter        = PMCNULL;
     STRING * const  handled_str = CONST_STRING(interp, "handled");
     STRING * const  iter_str    = CONST_STRING(interp, "handler_iter");
 
+    if (already_doing) {
+        Parrot_io_eprintf(interp,
+            "** Exception catched while looking for a handler, trying next **\n");
+        if (! keep_context)
+            return NULL;
+        /*
+         * Note that we are now trying to handle the new exception,
+         * not the initial task argument (exception or whatever).
+         */
+        context = keep_context->caller_ctx;
+        keep_context = NULL;
+        if (context && !PMC_IS_NULL(context->handlers))
+            iter = VTABLE_get_iter(interp, context->handlers);
+        else
+            iter = PMCNULL;
+    }
+    else {
+
+    ++already_doing;
+
     /* Exceptions store the handler iterator for rethrow, other kinds of
      * tasks don't (though they could). */
     if (task->vtable->base_type == enum_class_Exception
@@ -852,7 +881,10 @@
             iter = VTABLE_get_iter(interp, context->handlers);
     }
 
+    }
+
     while (context) {
+        keep_context = context;
         /* Loop from newest handler to oldest handler. */
         while (!PMC_IS_NULL(iter) && VTABLE_get_bool(interp, iter)) {
             PMC *handler = VTABLE_shift_pmc(interp, iter);
@@ -868,6 +900,8 @@
                         VTABLE_set_attr_str(interp, task, CONST_STRING(interp, "handler_iter"), iter);
                         VTABLE_set_pointer(interp, task, context);
                     }
+                    --already_doing;
+                    keep_context = NULL;
                     return handler;
                 }
             }
@@ -883,6 +917,7 @@
 
     /* Reached the end of the context chain without finding a handler. */
 
+    --already_doing;
     return PMCNULL;
 }
 

Modified: branches/vtable_morph_change/src/string/api.c
==============================================================================
--- branches/vtable_morph_change/src/string/api.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/string/api.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -762,7 +762,7 @@
 PARROT_CANNOT_RETURN_NULL
 STRING *
 Parrot_str_new_init(PARROT_INTERP, ARGIN_NULLOK(const char *buffer), UINTVAL len,
-        ARGIN(const ENCODING *encoding), ARGIN_NULLOK(const CHARSET *charset), UINTVAL flags)
+        ARGIN(const ENCODING *encoding), ARGIN(const CHARSET *charset), UINTVAL flags)
 {
     ASSERT_ARGS(Parrot_str_new_init)
     DECL_CONST_CAST;

Modified: branches/vtable_morph_change/src/string/charset.c
==============================================================================
--- branches/vtable_morph_change/src/string/charset.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/string/charset.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -63,6 +63,9 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
+static void Parrot_str_internal_register_charset_names(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
 static INTVAL register_charset(PARROT_INTERP,
     ARGIN(const char *charsetname),
     ARGIN(CHARSET *charset))
@@ -73,6 +76,9 @@
 static void register_static_converters(PARROT_INTERP)
         __attribute__nonnull__(1);
 
+#define ASSERT_ARGS_Parrot_str_internal_register_charset_names \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
 #define ASSERT_ARGS_register_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(charsetname) \
@@ -340,7 +346,6 @@
                 (n + 1) * sizeof (One_charset));
     all_charsets->n_charsets++;
     all_charsets->set[n].charset = charset;
-    all_charsets->set[n].name = Parrot_str_new_constant(interp, charsetname);
     all_charsets->set[n].n_converters = 0;
 
     return 1;
@@ -348,6 +353,28 @@
 
 /*
 
+=item C<static void Parrot_str_internal_register_charset_names>
+
+Helper function for initializing characterset names. We can't create the
+STRING names until the default encodings and charsets are already initted,
+so the name generation is split into a second init stage.
+
+=cut
+
+*/
+
+static void
+Parrot_str_internal_register_charset_names(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_str_internal_register_charset_names)
+    int n;
+    for (n = 0; n < all_charsets->n_charsets; n++)
+        all_charsets->set[n].name =
+            Parrot_str_new_constant(interp, all_charsets->set[n].charset->name);
+}
+
+/*
+
 =item C<static void register_static_converters>
 
 Registers several standard converters between common charsets, including:
@@ -462,10 +489,12 @@
     Parrot_charset_binary_init(interp);
     Parrot_charset_unicode_init(interp);
 
-    /*
-     * now encoding strings don't have a charset yet - set default
+    /* Now that the plugins are registered, we can create STRING
+     * names for them.
      */
-    parrot_init_encodings_2();
+    Parrot_str_internal_register_encoding_names(interp);
+    Parrot_str_internal_register_charset_names(interp);
+
     /*
      * now install charset converters
      */

Modified: branches/vtable_morph_change/src/string/charset/iso-8859-1.c
==============================================================================
--- branches/vtable_morph_change/src/string/charset/iso-8859-1.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/string/charset/iso-8859-1.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -97,7 +97,7 @@
         __attribute__nonnull__(2);
 
 PARROT_CANNOT_RETURN_NULL
-static STRING * to_latin1(PARROT_INTERP,
+static STRING * to_iso_8859_1(PARROT_INTERP,
     ARGIN(STRING *src),
     ARGMOD_NULLOK(STRING *dest))
         __attribute__nonnull__(1)
@@ -159,7 +159,7 @@
 #define ASSERT_ARGS_to_charset __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(src)
-#define ASSERT_ARGS_to_latin1 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_to_iso_8859_1 __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(src)
 #define ASSERT_ARGS_to_unicode __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -201,9 +201,9 @@
 
 /*
 
-=item C<static STRING * to_latin1>
+=item C<static STRING * to_iso_8859_1>
 
-Converts STRING C<src> to Latin1 in STRING C<dest>.
+Converts STRING C<src> to iso-8859-1 in STRING C<dest>.
 
 =cut
 
@@ -211,9 +211,9 @@
 
 PARROT_CANNOT_RETURN_NULL
 static STRING *
-to_latin1(PARROT_INTERP, ARGIN(STRING *src), ARGMOD_NULLOK(STRING *dest))
+to_iso_8859_1(PARROT_INTERP, ARGIN(STRING *src), ARGMOD_NULLOK(STRING *dest))
 {
-    ASSERT_ARGS(to_latin1)
+    ASSERT_ARGS(to_iso_8859_1)
     UINTVAL offs, src_len;
     String_iter iter;
 
@@ -224,7 +224,7 @@
         dest->strlen  = src_len;
     }
     else {
-        /* latin1 is never bigger then source */
+        /* iso-8859-1 is never bigger then source */
         dest = src;
     }
     dest->bufused = src_len;
@@ -234,7 +234,7 @@
         const UINTVAL c = iter.get_and_advance(interp, &iter);
         if (c >= 0x100)
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_LOSSY_CONVERSION,
-                "lossy conversion to ascii");
+                "lossy conversion to iso-8559-1");
 
         ENCODING_SET_BYTE(interp, dest, offs, c);
     }
@@ -306,7 +306,7 @@
     if (conversion_func)
         return conversion_func(interp, src, dest);
     else
-        return to_latin1(interp, src, dest);
+        return to_iso_8859_1(interp, src, dest);
 }
 
 

Modified: branches/vtable_morph_change/src/string/encoding.c
==============================================================================
--- branches/vtable_morph_change/src/string/encoding.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/string/encoding.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -58,29 +58,6 @@
 
 /*
 
-=item C<void parrot_init_encodings_2>
-
-Helper function for initializing characterset encodings. Initializes the
-C<all_encodings> array.
-
-=cut
-
-*/
-
-void
-parrot_init_encodings_2(void)
-{
-    ASSERT_ARGS(parrot_init_encodings_2)
-    const int n = all_encodings->n_encodings;
-    int i;
-
-    for (i = 0; i < n; ++i) {
-        all_encodings->enc[i].name->charset = Parrot_default_charset_ptr;
-    }
-}
-
-/*
-
 =item C<void parrot_deinit_encodings>
 
 Deinitialize encodings and free all memory used by them.
@@ -338,13 +315,35 @@
                 (n + 1) * sizeof (One_encoding));
     all_encodings->n_encodings++;
     all_encodings->enc[n].encoding = encoding;
-    all_encodings->enc[n].name = Parrot_str_new_constant(interp, encodingname);
 
     return 1;
 }
 
 /*
 
+=item C<void Parrot_str_internal_register_encoding_names>
+
+Helper function for initializing characterset encoding names. We can't create
+the STRING names until the default encodings and charsets are already initted,
+so the name generation is split into a second init stage.
+
+=cut
+
+*/
+
+
+void
+Parrot_str_internal_register_encoding_names(PARROT_INTERP)
+{
+    ASSERT_ARGS(Parrot_str_internal_register_encoding_names)
+    int n;
+    for (n = 0; n < all_encodings->n_encodings; n++)
+        all_encodings->enc[n].name =
+            Parrot_str_new_constant(interp, all_encodings->enc[n].encoding->name);
+}
+
+/*
+
 =item C<INTVAL Parrot_register_encoding>
 
 Registers a character encoding C<encoding> with name C<encodingname>.

Modified: branches/vtable_morph_change/src/sub.c
==============================================================================
--- branches/vtable_morph_change/src/sub.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/sub.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -62,7 +62,8 @@
     PObj *obj;
     int   i;
 
-    if (ctx->gc_mark == context_gc_mark) return;
+    if (ctx->gc_mark == context_gc_mark)
+        return;
     ctx->gc_mark = context_gc_mark;
 
     /* don't mark the context if it's actually dead */
@@ -355,13 +356,13 @@
              * have to save these and restore them to avoid affecting
              * the running program.
              */
-            PMC *saved_ccont            = interp->current_cont;
-            opcode_t *current_args      = interp->current_args;
-            opcode_t *current_params    = interp->current_params;
-            opcode_t *current_returns   = interp->current_returns;
-            PMC      *args_signature    = interp->args_signature;
-            PMC      *params_signature  = interp->params_signature;
-            PMC      *returns_signature = interp->returns_signature;
+            PMC      * const saved_ccont       = interp->current_cont;
+            opcode_t * const current_args      = interp->current_args;
+            opcode_t * const current_params    = interp->current_params;
+            opcode_t * const current_returns   = interp->current_returns;
+            PMC      * const args_signature    = interp->args_signature;
+            PMC      * const params_signature  = interp->params_signature;
+            PMC      * const returns_signature = interp->returns_signature;
 
             Parrot_block_GC_mark(interp);
 
@@ -659,8 +660,8 @@
 */
 
 void
-Parrot_continuation_check(PARROT_INTERP, ARGIN(PMC *pmc),
-    ARGIN(Parrot_cont *cc))
+Parrot_continuation_check(PARROT_INTERP, ARGIN(const PMC *pmc),
+    ARGIN(const Parrot_cont *cc))
 {
     ASSERT_ARGS(Parrot_continuation_check)
     Parrot_Context *to_ctx       = cc->to_ctx;
@@ -670,7 +671,7 @@
     if (Interp_debug_TEST(interp, PARROT_CTX_DESTROY_DEBUG_FLAG))
         fprintf(stderr,
                 "[invoke cont    %p, to_ctx %p, from_ctx %p (refs %d)]\n",
-                (void *)pmc, (void *)to_ctx, (void *)from_ctx, (int)from_ctx->ref_count);
+                (const void *)pmc, (void *)to_ctx, (void *)from_ctx, (int)from_ctx->ref_count);
 #endif
     if (!to_ctx)
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,

Modified: branches/vtable_morph_change/src/trace.c
==============================================================================
--- branches/vtable_morph_change/src/trace.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/trace.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -83,7 +83,7 @@
 trace_pmc_dump(PARROT_INTERP, ARGIN_NULLOK(PMC *pmc))
 {
     ASSERT_ARGS(trace_pmc_dump)
-    Interp * const debugger = interp->debugger;
+    Interp * const debugger = interp->pdb->debugger;
 
     if (!pmc) {
         Parrot_io_eprintf(debugger, "(null)");
@@ -170,7 +170,7 @@
 trace_key_dump(PARROT_INTERP, ARGIN(PMC *key))
 {
     ASSERT_ARGS(trace_key_dump)
-    Interp * const debugger = interp->debugger;
+    Interp * const debugger = interp->pdb->debugger;
 
     int len = Parrot_io_eprintf(debugger, "[");
 
@@ -255,7 +255,7 @@
     ASSERT_ARGS(trace_op_dump)
     INTVAL s, n;
     int more = 0, var_args;
-    Interp * const debugger = interp->debugger;
+    Interp * const debugger = interp->pdb->debugger;
     op_info_t * const info = &interp->op_info_table[*pc];
     PMC *sig;
     int type;

Modified: branches/vtable_morph_change/src/warnings.c
==============================================================================
--- branches/vtable_morph_change/src/warnings.c	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/src/warnings.c	Tue Feb 10 02:09:33 2009	(r36517)
@@ -49,7 +49,9 @@
 print_pbc_location(PARROT_INTERP)
 {
     ASSERT_ARGS(print_pbc_location)
-    Interp * const tracer = interp->debugger ? interp->debugger : interp;
+    Interp * const tracer = (interp->pdb && interp->pdb->debugger) ?
+        interp->pdb->debugger :
+        interp;
     Parrot_io_eprintf(tracer, "%Ss\n",
             Parrot_Context_infostr(interp,
                 CONTEXT(interp)));

Modified: branches/vtable_morph_change/t/codingstd/copyright.t
==============================================================================
--- branches/vtable_morph_change/t/codingstd/copyright.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/codingstd/copyright.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -46,7 +46,7 @@
 my @gmtime       = gmtime(time);
 my $current_year = $gmtime[5] + 1900;
 my $copyright_text =
-    "Copyright \\(C\\) (\\d{4}\\-$current_year|$current_year), The Perl Foundation.";
+    "Copyright \\(C\\) (\\d{4}\\-$current_year|$current_year), Parrot Foundation.";
 
 foreach my $file (@files) {
 

Modified: branches/vtable_morph_change/t/codingstd/pdd_format.t
==============================================================================
--- branches/vtable_morph_change/t/codingstd/pdd_format.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/codingstd/pdd_format.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2001-2005, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
 # $Id$
 
 use strict;
@@ -18,13 +18,12 @@
 
 my @pddfiles = ();
 foreach my $dir (@pdddirs) {
-    my @pdds;
     opendir my $DIRH, $dir
         or croak "Unable to open directory handle: $!";
-    @pdds = map { qq|$dir/$_| } grep { m/^pdd\d{2,}_.*\.pod$/ }
+    my @pdds = map { qq|$dir/$_| } grep { m/^pdd\d{2,}_.*\.pod$/ }
         readdir $DIRH;
     closedir $DIRH or croak "Unable to close directory handle: $!";
-    @pddfiles = (@pddfiles, @pdds);
+    push @pddfiles, @pdds;
 }
 
 my @diagnostics = ();
@@ -52,12 +51,11 @@
     my $diag = q{};
     my @toolong = ();
     my @sections_needed = qw(
-        NAME
-        VERSION
-        ABSTRACT
-        DESCRIPTION
-        IMPLEMENTATION
-        REFERENCES
+        Version
+        Abstract
+        Description
+        Implementation
+        References
     );
     my %sections_seen = map { $_, 0 } @sections_needed;
     my @lines;
@@ -72,7 +70,7 @@
             push @toolong, ($i + 1);
         }
         foreach my $need ( @sections_needed ) {
-            $sections_seen{$need}++ if $lines[$i] =~ m{^=head1\s+$need};
+            $sections_seen{$need}++ if $lines[$i] =~ m{^=head2\s+$need};
         }
     }
     untie @lines or croak "Unable to untie from $pdd: $!";
@@ -84,7 +82,7 @@
     }
     foreach my $need ( keys %sections_seen ) {
         if ( ! $sections_seen{$need} ) {
-            $diag .= qq{$base lacks 'head1' $need section\n};
+            $diag .= qq{$base lacks 'head2' $need section\n};
         }
     }
     return $diag;

Modified: branches/vtable_morph_change/t/codingstd/perlcritic.t
==============================================================================
--- branches/vtable_morph_change/t/codingstd/perlcritic.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/codingstd/perlcritic.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -2,10 +2,37 @@
 # Copyright (C) 2008-2009, The Perl Foundation.
 # $Id$
 
+=head1 NAME
+
+t/codingstd/perlcritic.t - use perlcritic for perl coding stds.
+
+=head1 SYNOPSIS
+
+ # test all files
+ % prove t/codingstd/perlcritic.t
+
+ % perl t/codingstd/perlcritic.t [--theme=sometheme]
+
+ # test specific files
+ % perl t/codingstd/perlcritic.t src/foo.pl lib/parrot/bar.pm
+
+=head1 DESCRIPTION
+
+By default, tests all perl source files for some very specific perl coding
+violations.
+
+This test uses a standard perlcriticrc file, located in
+F<tools/utils/perlcritic.conf>
+
+If you wish to run a specific policy, the easiest way to do so is to
+temporarily add a custom theme to the configuration file and then specify
+that on the command line to this script.
+
+=cut
+
 use strict;
 use warnings;
-
-use lib qw{lib};
+use lib qw( lib ../lib ../../lib );
 
 use File::Spec;
 use Getopt::Long;
@@ -29,7 +56,7 @@
     'theme=s'   => \$theme
 );
 
-my $config = File::Spec->catfile( qw{tools util perlcritic.conf} );
+my $config = File::Spec->catfile( $PConfig{build_dir}, qw{tools util perlcritic.conf} );
 
 Test::Perl::Critic->import(
     -profile => $config,
@@ -52,18 +79,7 @@
              grep { $_->read !~ m/use v6;/ }
              $dist->get_perl_language_files();
 } else {
-    my $node = shift;
-    if (-f $node) {
-        @files = ($node);
-    } elsif (-d $node) {
-
-        $node = File::Spec->rel2abs( $node );
-        @files = grep { m/^$node/ }
-                 map { $_->path }
-                 $dist->get_perl_language_files();
-    } else {
-        die "invalid file '$node' specified.\n";
-    }
+    @files = <@ARGV>;
 }
 
 plan(tests => scalar(@files));
@@ -75,37 +91,6 @@
   exit;
 }
 
-
-__END__
-
-=head1 NAME
-
-t/codingstd/perlcritic.t - use perlcritic for perl coding stds.
-
-=head1 SYNOPSIS
-
- % prove t/codingstd/perlcritic.t
-
- % perl t/codingstd/perlcritic.t [--theme=sometheme] [file|directory]
-
-=head1 DESCRIPTION
-
-By default, tests all perl source files for some very specific perl coding
-violations.
-
-Optionally specify a file on the command line to test B<only>
-that file. If you specify a directory, any perl files under that directory
-are tested.
-
-This test uses a standard perlcriticrc file, located in
-F<tools/utils/perlcritic.conf>
-
-If you wish to run a specific policy, the easiest way to do so is to
-temporarily add a custom theme to the configuration file and then specify
-that on the command line to this script.
-
-=cut
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4

Copied: branches/vtable_morph_change/t/dynpmc/pair.t (from r36514, trunk/t/dynpmc/pair.t)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/vtable_morph_change/t/dynpmc/pair.t	Tue Feb 10 02:09:33 2009	(r36517, copy of r36514, trunk/t/dynpmc/pair.t)
@@ -0,0 +1,85 @@
+#! parrot
+# Copyright (C) 2001-2009, The Perl Foundation.
+# $Id$
+
+.const int NUM_OF_TESTS = 8
+
+.sub main :main
+    loadlib $P1, 'pair'
+    load_bytecode 'library/Test/More.pir'
+
+    .local pmc plan, is, ok
+    plan = get_hll_global [ 'Test'; 'More' ], 'plan'
+    is   = get_hll_global [ 'Test'; 'More' ], 'is'
+    ok   = get_hll_global [ 'Test'; 'More' ], 'ok'
+
+    # set a test plan
+    plan(NUM_OF_TESTS)
+
+    new $P0, ['Pair']
+    ok(1, "still alive")
+    new $P1, ['Integer']
+    set $P1, 42
+    set $P0["key"], $P1
+    ok(1, "still alive")
+    set $P2, $P0["key"]
+    is($P2, 42, "fetching value")
+
+    .local pmc p, kv
+    new p, ['Pair']
+    new $P1, ['Integer']
+    set $P1, 42
+    set p["key"], $P1
+
+    $P0 = p."key"()
+    is( $P0, 'key', 'get key' )
+    $P0 = p."value"()
+    is( $P0, 42, 'get key' )
+    kv = p."kv"()
+    $I0 = elements kv
+    is( $I0, 2, 'number of elements returned from "kv"' )
+    $P0 = kv[0]
+    is( $P0, 'key', 'first element returned from "kv"' )
+    $P0 = kv[1]
+    is( $P0, 42, 'third element returned from "kv"' )
+.end
+
+=for get it
+
+SKIP: {
+    skip( "instantiate disabled", 1 );
+    pir_output_is( <<'CODE', <<'OUT', 'instantiate, assign' );
+.sub main :main
+    .local pmc cl, p, kv, k, v
+    k = new ['String']
+    k = "key"
+    v = new ['String']
+    v = "value"
+    cl = get_class "Pair"
+    p = cl."instantiate"(k, v)
+
+    $P0 = p."key"()
+    print $P0
+    print ' '
+    $P0 = p."value"()
+    print $P0
+    print ' '
+
+    v = new ['Integer']
+    v = 77
+    assign p, v
+    $P0 = p."value"()
+    say $P0
+.end
+CODE
+key value 77
+OUT
+}
+
+=cut
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Modified: branches/vtable_morph_change/t/native_pbc/integer.t
==============================================================================
--- branches/vtable_morph_change/t/native_pbc/integer.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/native_pbc/integer.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -38,13 +38,13 @@
 
 The output of
 
-  $ pdump -h i.pbc
+  $ pbc_dump -h i.pbc
 
 should be included for reference.
 
 On test failures please add the output of
 
-  $ ./pdump -h t/native_pbc/number_${N}.pbc
+  $ ./pbc_dump -h t/native_pbc/number_${N}.pbc
 
 into your report. We need your wordsize/floattype/endianess.
 

Modified: branches/vtable_morph_change/t/native_pbc/number.t
==============================================================================
--- branches/vtable_morph_change/t/native_pbc/number.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/native_pbc/number.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -32,20 +32,20 @@
 # please add it:
 
   $ ./parrot -o n.pbc t/op/number_1.pasm
-  $ make pdump
-  $ ./pdump -h n.pbc
+  $ make pbc_dump
+  $ ./pbc_dump -h n.pbc
   $ mv n.pbc t/native_pbc/number_$(N).pbc
 
 # then
 # - increase number of tests
-# - include the pdump header info for reference
+# - include the pbc_dump header info for reference
 # - put the file into MANIFEST
 # - add the file as binary (svn add) and commit it
 # thanks -leo
 
 On test failures please add the output of
 
-  $ ./pdump -h t/native_pbc/number_${N}.pbc
+  $ ./pbc_dump -h t/native_pbc/number_${N}.pbc
 
 into your report. We need your wordsize/floattype/endianess.
 

Modified: branches/vtable_morph_change/t/oo/attributes.t
==============================================================================
--- branches/vtable_morph_change/t/oo/attributes.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/oo/attributes.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,6 +1,6 @@
 #! parrot
 # Copyright (C) 2008, The Perl Foundation.
-# $Id: $
+# $Id$
 
 =head1 NAME
 

Modified: branches/vtable_morph_change/t/oo/inheritance.t
==============================================================================
--- branches/vtable_morph_change/t/oo/inheritance.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/oo/inheritance.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,6 +1,6 @@
 #! parrot
 # Copyright (C) 2008, The Perl Foundation.
-# $Id: $
+# $Id$
 
 =head1 NAME
 

Modified: branches/vtable_morph_change/t/perl/Parrot_Distribution.t
==============================================================================
--- branches/vtable_morph_change/t/perl/Parrot_Distribution.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/perl/Parrot_Distribution.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -6,7 +6,7 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 
-use Test::More tests => 30;
+use Test::More tests => 29;
 use File::Spec;
 
 =head1 NAME
@@ -55,7 +55,6 @@
     'languages/APL/src/pmc',
     'languages/dotnet/pmc',
     'languages/lua/src/pmc',
-    'languages/perl6/src/pmc',
     map { File::Spec->catdir( 'src', $_ ) } qw(dynpmc pmc)
 );
 

Deleted: branches/vtable_morph_change/t/pmc/bignum.t
==============================================================================
--- branches/vtable_morph_change/t/pmc/bignum.t	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,296 +0,0 @@
-#!perl
-# $Id$
-
-# Copyright (C) 2002-2007, The Perl Foundation.
-
-=head1 NAME
-
-t/pmc/bignum.t - Test the non-implemented BigNum PMC.
-
-=head1 DESCRIPTION
-
-Does nothing yet, as there is no BigNum PMC yet.
-
-The idea is to run the test cases parsed out of *.decTest, available
-from: http://www2.hursley.ibm.com/decimal/dectest.html
-
-=head1 HISTORY
-
-This was started by Alex Gogh, who went to work in Antarctica, http://the.earth.li/~alex/halley/.
-The script was supposed to test bignum.c, which should become the basis for a
-BigNum PMC.
-
-=head1 TODO
-
-This is very broken.
-
-==head1 SEE ALSO
-
-F<docs/docs/pdds/draft/pdd14_bignum.pod>,
-L<https://rt.perl.org/rt3/Ticket/Display.html?id=36330>
-
-=cut
-
-use strict;
-use warnings;
-
-use Test::More skip_all => 'No BigNum support yet.';
-
-my ( $test, $one, $two, $result, $prec, $round, $maxexp, $skip, $op, @conds, $line, $arrow );
-
-my ( $testsrun, $testspass, $testsfail, $extended ) = ( 0, 0, 0, 0 );
-$maxexp = 999999999;
-while (<>) {
-    chomp;
-    next if /^\s*--/;
-    s/\s*--.*$//;    # and hope it's not quoted
-    next unless /\S/;
-    /^precision:\s+(\d+)/ && do {
-        $precision = $1;
-        next;
-    };
-    /^rounding:\s*(\w+)/ && do {
-        $round = $1;
-        next;
-    };
-    /^extended:\s*(\d+)/ && do {
-        $extended = $1;
-        next;
-    };
-    /^version/               && next;
-    /^maxexponent:\s*(\d+)/i && do {
-        $expskip = 1 if ( $1 > $maxexp );
-        if ( $1 <= $maxexp ) {
-            $expskip = 0;
-        }
-        next;
-    };
-
-    ( $test, $op, $one, $two, $arrow, $result, @conds ) = split( /\s+/, $_ );
-
-    # skip null tests
-    if ( $one eq '#' || $two eq '#' ) {
-        print "$test ok \# skip, null test\n";
-        next;
-    }
-
-    if ( $round !~ /^(half_up|half_even|down|floor|ceiling)$/ ) {
-        print "$test ok \# skip, $round not available\n";
-        next;
-    }
-
-    if ( $op =~ /^(power|rescale)$/ ) {
-        print "$test ok \# skip, $op not implemented\n";
-        next;
-    }
-
-    if ( $two eq '->' ) {    # unary op
-        unshift( @conds, $result ) if defined $result;
-        ( $two, $result, @conds ) = ( '0', $arrow, @conds );
-    }
-
-    if ( !defined($result) ) {
-        print "$test skip\n";
-        next;
-    }
-
-    if ($expskip) {
-        print "$test ok \# skip\n";
-        next;
-    }
-
-    for ( $one, $two, $result ) {
-        s/^'|'$//g;
-    }
-
-    $testsrun += 2;
-    my ($output) = run_single_test( $one $two $op $precision $round $extended );
-    chomp($output);
-    my @out = split( /\s+/, $output );
-    if ( $result eq $out[0] || ( $result eq '?' ) ) {
-        print "$test ok\n";
-        $testspass++;
-    }
-    else {
-        print "$test not ok\n";
-        print "  $one $op $two\n    (p:$precision r:$round)\n";
-        print " => `", join( "'`", @out ), "'\n";
-        print " ex `$result', ", ( @conds ? join( " ", @conds ) : '-' ), "\n";
-        $testsfail++;
-    }
-
-    # check flag status
-    my ( %conds, %outs );
-    my $tpass = 0;
-    if (@conds) {
-
-        # need to map conditions, as signals and conditions don't quite mesh
-        my %map = (
-            Division_impossible => 'Invalid_operation',
-            Division_undefined  => 'Invalid_operation'
-        );
-        foreach (@conds) {
-            if ( $map{$_} ) {
-                $_ = $map{$_};
-            }
-        }
-        if ( @out > 1 ) {
-            $conds{$_} = 1 foreach @conds;
-            $outs{$_} = 1 foreach @out[ 1 .. ( @out - 1 ) ];
-            $tpass = 1;
-            foreach ( keys %conds ) {
-                $tpass = 0 unless $outs{$_};
-            }
-            foreach ( keys %outs ) {
-                $tpass = 0 unless $conds{$_};
-            }
-        }
-    }
-    elsif ( @out == 1 ) {
-        $tpass = 1;
-    }
-
-    if ($tpass) {
-        print "$test ok\n";
-        $testspass++;
-    }
-    else {
-        print "$test not ok\n";
-        print "  $one $op $two\n    (p:$precision r:$round)\n";
-        print " => `", join( "'`", @out ), "'\n";
-        print " ex `$result', ", ( @conds ? join( " ", @conds ) : '-' ), "\n";
-        $testsfail++;
-    }
-
-}
-
-# RT #46863 The following used to be bignum_test.pl.
-# Maybe it should be factored out to Parrot::Test::BigNum.
-
-# This allows a single bignum test to be run directly through the C
-# library.  Usage available by getting the args wrong.
-
-use lib "../lib";
-use Inline C => Config => CCFLAGS => '-I.';
-use Inline C => <<'END_OF_C_SECTION';
-#include "bignum.c"
-
-int runtest (char* lef, char *rih, int oper, int prec, int round, int extended) {
-  BIGNUM *one, *two, *result;
-  char *output;
-  BN_CONTEXT context;
-  char *traps[7] = {"Lost_digits","Division_by_zero","Inexact",
-                    "Invalid_operation","Overflow","Rounded","Underflow"};
-
-  context.elimit = 999999999;
-  context.precision = prec;
-  context.extended = extended;
-  context.flags = 0;
-  context.traps = 0;
-  switch (round) {
-  case 1 : context.rounding = ROUND_HALF_UP;
-    break;
-  case 2 : context.rounding = ROUND_DOWN;
-    break;
-  case 3 : context.rounding = ROUND_HALF_EVEN;
-    break;
-  case 4 : context.rounding = ROUND_CEILING;
-    break;
-  case 5 : context.rounding = ROUND_FLOOR;
-    break;
-  default : printf("Unknown rounding %i\n", round);
-    exit(EXIT_FAILURE);
-  }
-
-  one = BN_from_string(lef, &context);
-  two = BN_from_string(rih, &context);
-
-  result = BN_new(1);
-
-  switch (oper) {
-  case 1 : BN_add(result, one, two, &context);
-    break;
-  case 2 : BN_subtract(result, one, two, &context);
-    break;
-  case 3 : BN_plus(result, one, &context);
-    break;
-  case 4 : BN_minus(result, one, &context);
-    break;
-  case 5 : BN_compare(result, one, two, &context);
-    break;
-  case 6 : BN_multiply(result, one, two, &context);
-    break;
-  case 7 : BN_divide(result, one, two, &context);
-    break;
-  case 8 : BN_divide_integer(result, one, two, &context);
-    break;
-  case 9 : BN_remainder(result, one, two, &context);
-    break;
-  case 10: BN_rescale(result, one, two, &context);
-    break;
-  case 11: BN_power(result, one, two, &context);
-    break;
-
-  default : printf("No operation of type %i\n", oper);
-    exit(EXIT_SUCCESS);
-  }
-
-  BN_to_scientific_string(result, &output);
-  printf("%s", output);
-  {
-      int i;
-      for (i=0; i< 7; i++)
-          if ((1 << i) & context.flags) printf(" %s", traps[i]);
-  }
-  printf("\n");
-  return 1;
-}
-END_OF_C_SECTION
-
-my %ops = (
-    add       => 1,
-    subtract  => 2,
-    plus      => 3,
-    minus     => 4,
-    compare   => 5,
-    multiply  => 6,
-    divide    => 7,
-    divideint => 8,
-    remainder => 9,
-    rescale   => 10,
-    power     => 11,
-);
-
-my %round = (
-    half_up   => 1,
-    down      => 2,
-    half_even => 3,
-    ceiling   => 4,
-    floor     => 5,
-);
-
-sub run_single_test {
-    unless ( @_ == 6 ) {
-        die <<ENDOFUSAGE;
-bignum_test.pl -- run test through bignum.c
-bignum_test.pl one two operation precision rounding extended
-ENDOFUSAGE
-    }
-
-    for ( $_[0], $_[1] ) {
-        s/^"|"$//g;
-        s/""/\"/g;
-        s/^'|'$//g;
-        s/''/\'/g;
-    }
-
-    # RT #46865 Capture STDOUT
-    runtest( $_[0], $_[1], $ops{ $ARGV[2] }, $_[3], $round{ $_[4] }, $_[5] );
-}
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/vtable_morph_change/t/pmc/exceptionhandler.t
==============================================================================
--- branches/vtable_morph_change/t/pmc/exceptionhandler.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/pmc/exceptionhandler.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -115,9 +115,15 @@
     ok($I0, 'Exception Handler subclass popped')
     $I0 = subclass_handler_catches_can(myhandlercan)
     ok($I0, 'Exception Handler subclass with can_handle method catch exception')
-    skip(1,'Exception Handler subclass causes segfault: TT #154')
-    #$I0 = subclass_handler_catches(myhandler)
-    #todo($I0, 'Exception Handler subclass catch exception')
+
+    # This test is not expected to die now.
+    # Please report to TT #154 if it must be skipped again.
+    #skip(1,'Exception Handler subclass causes segfault: TT #154')
+    $I0 = 0
+    push_eh outcatch
+    $I0 = subclass_handler_catches(myhandler)
+  outcatch:
+    todo($I0, 'Exception Handler subclass catch exception')
 .end
 
 .sub subclass_exception_handler

Modified: branches/vtable_morph_change/t/steps/auto_format-01.t
==============================================================================
--- branches/vtable_morph_change/t/steps/auto_format-01.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/steps/auto_format-01.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -97,9 +97,12 @@
     );
 }
 {
+    use Config;
+    my $p5format = '%.15' . $Config{sPRIgldbl};
+    $p5format =~ s/"//g;; # Perl 5's Config value has embedded double quotes
     $conf->data->set( nv => 'long double' );
     auto::format::_set_floatvalfmt_nvsize($conf);
-    is($conf->data->get( 'floatvalfmt' ), '%Lf',
+    is($conf->data->get( 'floatvalfmt' ), $p5format,
         "floatvalfmt set as expected");
     is($conf->data->get( 'nvsize' ), $conf->data->get( 'hugefloatvalsize' ),
         "nvsize set as expected");

Modified: branches/vtable_morph_change/t/steps/gen_makefiles-01.t
==============================================================================
--- branches/vtable_morph_change/t/steps/gen_makefiles-01.t	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/t/steps/gen_makefiles-01.t	Tue Feb 10 02:09:33 2009	(r36517)
@@ -1,5 +1,5 @@
 #! perl
-# Copyright (C) 2007, The Perl Foundation.
+# Copyright (C) 2007-2009, The Perl Foundation.
 # $Id$
 # gen_makefiles-01.t
 
@@ -11,11 +11,11 @@
     @cond_tests =
       (
        # perl-syntax       true or false
-       ["IF(true)", 		1],
-       ["IF(false)", 		0],
-       ["UNLESS(true)",	        0],
-       ["UNLESS(false)",	1],
-       ["IF(true | false)",	1],
+       ["IF(true)",             1],
+       ["IF(false)",            0],
+       ["UNLESS(true)",         0],
+       ["UNLESS(false)",        1],
+       ["IF(true | false)",     1],
        ["IF(true & false)",     0],
        ["IF(true or true)",     1],
        ["IF(true or false)",    1],
@@ -27,16 +27,16 @@
        ["IF(false and false)",  0],
        ["UNLESS(true|false)",   0],
        ["UNLESS(true&false)",   1],
-       ["IF(!false)", 		1],
-       ["IF(true)", 		1],
-       ["ELSIF(value)", 	0],
-       ["ELSE", 	        0],
-       ["IF(false)", 		0],
-       ["ELSIF(value)", 	1],
-       ["ELSE", 	        0],
-       ["IF(false)", 		0],
-       ["ELSIF(false)", 	0],
-       ["ELSE", 	        1],
+       ["IF(!false)",           1],
+       ["IF(true)",             1],
+       ["ELSIF(value)",         0],
+       ["ELSE",                 0],
+       ["IF(false)",            0],
+       ["ELSIF(value)",         1],
+       ["ELSE",                 0],
+       ["IF(false)",            0],
+       ["ELSIF(false)",         0],
+       ["ELSE",                 1],
        # Exercise the parser
        ["IF(true and (!false and value))",  1],
        ["IF(true and (!false) and value)",  1],
@@ -54,10 +54,10 @@
        ["IF(not (false or value))",         0],
        ["IF(true and not false)",           1],
        # platform
-       ["IF(someplatform)",		    1],
-       ["IF(not someplatform)",		    0],
-       ["UNLESS(someplatform)",		    0],
-       ["UNLESS(not someplatform)",	    1],
+       ["IF(someplatform)",                 1],
+       ["IF(not someplatform)",             0],
+       ["UNLESS(someplatform)",             0],
+       ["UNLESS(not someplatform)",         1],
        # key==value
        ["IF(value==xx)",                    1],
        ["IF(value==xxy)",                   0],
@@ -65,21 +65,24 @@
        ["UNLESS(value==xxy)",               1],
        ["IF(true & (value==xx & (!false)))",1],
        # These are invalid:
-       #["IF(value == xx)",                  0], # invalid op error
-       #["IF(value = xx)",                   0], # invalid op error
+       #["IF(value == xx)",                 0], # invalid op error
+       #["IF(value = xx)",                  0], # invalid op error
        ["IF(value=xx)",                     0], # also invalid, no warning. checks for key value=xx
 
        # Legacy syntax                 true or false
-       ["CONDITIONED_LINE(true)", 	    1],
+       ["CONDITIONED_LINE(true)",           1],
        ["INVERSE_CONDITIONED_LINE(true)",   0],
-       ["CONDITIONED_LINE(false)", 	    0],
+       ["CONDITIONED_LINE(false)",          0],
        ["INVERSE_CONDITIONED_LINE(false)",  1],
       );
 }
-use Test::More tests => (7 + scalar(@cond_tests));
+
+use Test::More tests => (8 + @cond_tests);
 use Carp;
 use lib qw( . lib );
+
 use_ok('config::gen::makefiles');
+
 use Parrot::Configure;
 use Parrot::Configure::Options qw( process_options );
 use Parrot::Configure::Test qw(
@@ -96,16 +99,20 @@
     }
 );
 
-my $conf = Parrot::Configure->new;
-my $pkg = q{gen::makefiles};
+my $conf = Parrot::Configure->new();
+my $pkg  = 'gen::makefiles';
+
 $conf->add_steps($pkg);
 $conf->options->set( %{$args} );
-my $step = test_step_constructor_and_description($conf);
+
+my $step           = test_step_constructor_and_description($conf);
 my $missing_SOURCE = 0;
-my %makefiles = %{ $step->{makefiles} };
+my %makefiles      = %{ $step->{makefiles} };
+
 foreach my $k ( keys %makefiles ) {
     $missing_SOURCE++ unless (-f $makefiles{$k}{SOURCE});
 }
+
 is($missing_SOURCE, 0, "No Makefile source file missing");
 ok(-f $step->{CFLAGS_source}, "CFLAGS source file located");
 
@@ -121,29 +128,36 @@
     $s =~ s/[\()]//g;
     $s =~ s/ /_/g;
     $s .= ("_".++$index) if $s =~ /^(ELSE|ELSIF)/;
+
     return $s."=".($c->[1]?"true":"false");
 }
+
 # test #IF(keys):line
 $conf->data->set( @conf_args, ('osname' => 'someplatform' ) );
-open IN, ">", "Makefile_$$.in";
-print IN "# There should only be =true results in .out\n";
+
+open my $IN, ">", "Makefile_$$.in";
+print $IN "# There should only be =true results in .out\n";
 for my $c (@cond_tests) {
     my $result = result($c);
-    print IN "#$c->[0]:$result\n";
+    print $IN "#$c->[0]:$result\n";
 }
-close IN;
+
+close $IN;
+
 $conf->genfile("Makefile_$$.in", "Makefile_$$.out",
-	       (makefile => 1, conditioned_lines => 1));
-open OUT, "<", "Makefile_$$.out";
+           (makefile => 1, conditioned_lines => 1));
+
+open my $OUT, "<", "Makefile_$$.out";
+
 my $f;
 {
     local $/;
-    $f = <OUT>;
-}
-END {
-    unlink "Makefile_$$.in", "Makefile_$$.out";
+    $f = <$OUT>;
 }
+
+close $OUT;
 $index = undef;
+
 for my $c (@cond_tests) {
     my $result = result($c);
     if ($c->[2] and $c->[2] =~ /^TODO(.*)$/) {
@@ -155,8 +169,28 @@
     }
 }
 
+# TT #279: reporting the makefile line number
+# step gen::makefiles died during execution:
+#  invalid op "IF" in "#IF(bla)" at "(bla)" at Configure.pl line 72
+open $IN, ">", "Makefile_$$.in";
+print $IN "# Test reporting sourcefile line numbers. TT #279\n";
+print $IN "#IF(IF(bla)):test\n";
+close $IN;
+eval {
+    $conf->genfile("Makefile_$$.in", "Makefile_$$.out",
+                   (makefile => 1, conditioned_lines => 1));
+};
+
+my $error = $@;
+ok($error eq "invalid op \"bla\" in \"IF(bla)\" at \"(bla)\" at Makefile_$$.in line 2\n",
+   "report correct error line");
+
 pass("Completed all tests in $0");
 
+END {
+    unlink "Makefile_$$.in", "Makefile_$$.out", "Makefile_$$.out.tmp";
+}
+
 ################### DOCUMENTATION ###################
 
 =head1 NAME
@@ -176,6 +210,7 @@
 =head1 AUTHOR
 
 James E Keenan
+Reini Urban
 
 =head1 SEE ALSO
 

Modified: branches/vtable_morph_change/tools/dev/mk_native_pbc
==============================================================================
--- branches/vtable_morph_change/tools/dev/mk_native_pbc	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/tools/dev/mk_native_pbc	Tue Feb 10 02:09:33 2009	(r36517)
@@ -25,8 +25,8 @@
 ./parrot -o n.pbc t/op/number_1.pasm
 mv n.pbc t/native_pbc/number_1.pbc
 
-make pdump
-./pdump -h t/native_pbc/number_1.pbc
-./pdump -h t/native_pbc/number_2.pbc
+make pbc_dump
+./pbc_dump -h t/native_pbc/number_1.pbc
+./pbc_dump -h t/native_pbc/number_2.pbc
 
 perl t/harness t/native_pbc/number.t

Modified: branches/vtable_morph_change/tools/dev/pbc_header.pl
==============================================================================
--- branches/vtable_morph_change/tools/dev/pbc_header.pl	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/tools/dev/pbc_header.pl	Tue Feb 10 02:09:33 2009	(r36517)
@@ -30,7 +30,7 @@
 
 =head1 SEE ALSO
 
-The C<pdump> utility does a much more thorough job of showing bytecode file
+The C<pbc_dump> utility does a much more thorough job of showing bytecode file
 headers.
 
 =cut

Copied: branches/vtable_morph_change/tools/dev/pbc_to_exe.pir (from r36514, trunk/tools/dev/pbc_to_exe.pir)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/vtable_morph_change/tools/dev/pbc_to_exe.pir	Tue Feb 10 02:09:33 2009	(r36517, copy of r36514, trunk/tools/dev/pbc_to_exe.pir)
@@ -0,0 +1,371 @@
+#! parrot
+
+=head1 TITLE
+
+pbc_to_exe
+
+=head2 SYNOPSIS
+
+  pbc_to_exe my.pbc
+  => my.exe
+
+  pbc_to_exe my.pbc --install
+  => installable_my.exe
+
+Warning! With --install there must be no directory prefix in the first arg yet.
+
+=cut
+
+.include 'library/config.pir'
+
+.sub 'main' :main
+    .param pmc    argv
+    .local string infile
+    .local string cfile
+    .local string objfile
+    .local string exefile
+    .local string out
+
+    (infile, cfile, objfile, exefile) = 'handle_args'(argv)
+    unless infile > '' goto err_infile
+
+    .local string codestring
+    codestring = 'generate_code'(infile)
+
+  open_outfile:
+    .local pmc outfh
+    outfh = open cfile, 'w'
+    unless outfh goto err_outfh
+    print outfh, <<'HEADER'
+#include "parrot/parrot.h"
+#include "parrot/embed.h"
+HEADER
+
+    print outfh, codestring
+
+    print outfh, <<'MAIN'
+        int main(int argc, char *argv[])
+        {
+            PackFile     *pf;
+            Parrot_Interp interp;
+
+            Parrot_set_config_hash();
+
+            interp = Parrot_new( NULL );
+
+            if (!interp)
+                return 1;
+
+            Parrot_set_executable_name(interp,
+                Parrot_str_new(interp, argv[0], 0));
+            Parrot_set_flag(interp, PARROT_DESTROY_FLAG);
+
+            pf = PackFile_new(interp, 0);
+
+            if (!PackFile_unpack(interp, pf,
+                    (const opcode_t *)program_code, bytecode_size))
+                return 1;
+
+            do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
+
+            Parrot_loadbc(interp, pf);
+
+            PackFile_fixup_subs(interp, PBC_MAIN, NULL);
+            Parrot_runcode(interp, argc, argv);
+            Parrot_destroy(interp);
+            Parrot_exit(interp, 0);
+        }
+MAIN
+
+    close outfh
+    'compile_file'(cfile, objfile)
+    'link_file'(objfile, exefile)
+    .return ()
+
+  err_infile:
+    die "cannot read infile"
+  err_outfh:
+    die "cannot write outfile"
+.end
+
+
+.sub 'handle_args'
+    .param pmc argv
+
+    .local pmc args
+    args   = argv
+
+    .local int argc
+    argc = args
+
+    if argc == 2 goto proper_args
+    if argc == 3 goto check_install
+    .return ()
+
+  check_install:
+    .local string infile, install
+
+    $P0    = shift args
+    infile = shift args
+    install = shift args
+    if install == '--install' goto proper_install
+    .return ()
+
+  proper_install:
+    .local string cfile, objfile, obj, exefile, exe
+
+    $P0    = '_config'()
+    obj    = $P0['o']
+    exe    = $P0['exe']
+
+    .local int infile_len
+    infile_len  = length infile
+    infile_len -= 3
+
+    cfile       = substr infile, 0, infile_len
+    cfile      .= 'c'
+
+    dec infile_len
+    objfile     = substr infile, 0, infile_len
+    exefile     = 'installable_'
+    exefile    .= objfile
+    exefile    .= exe
+    objfile    .= obj
+    .return(infile, cfile, objfile, exefile)
+
+  proper_args:
+    .local string infile, cfile, objfile, obj, exefile, exe
+
+    $P0    = '_config'()
+    obj    = $P0['o']
+    exe    = $P0['exe']
+
+    $P0    = shift args
+    infile = shift args
+
+    .local int infile_len
+    infile_len  = length infile
+    infile_len -= 3
+
+    cfile       = substr infile, 0, infile_len
+    cfile      .= 'c'
+
+    dec infile_len
+    objfile     = substr infile, 0, infile_len
+    objfile    .= obj
+    exefile     = substr infile, 0, infile_len
+    exefile    .= exe
+
+    # substitute .c for .pbc
+    # remove .c for executable
+
+    # TODO this should complain about results/returns mismatch
+    .return(infile, cfile, objfile, exefile)
+.end
+
+.sub 'generate_code'
+    .param string infile
+    .local pmc ifh
+    ifh = open infile, 'r'
+    unless ifh goto err_infile
+    .local string codestring
+    .local int size
+    codestring = "const Parrot_UInt1 program_code[] = {"
+    size = 0
+
+  read_loop:
+    .local string pbcstring
+    .local int pbclength
+
+    pbcstring = read ifh, 16384
+    pbclength = length pbcstring
+    unless pbclength > 0 goto read_done
+
+    .local int pos
+    pos = 0
+  code_loop:
+    unless pos < pbclength goto code_done
+    $I0 = ord pbcstring, pos
+    $S0 = $I0
+    codestring .= $S0
+    codestring .= ','
+    inc pos
+    inc size
+    $I0 = size % 32
+    unless $I0 == 0 goto code_loop
+    codestring .= "\n"
+    goto code_loop
+  code_done:
+    goto read_loop
+
+  read_done:
+    close ifh
+
+    codestring .= "\n};\n\n"
+    codestring .= "const int bytecode_size = "
+    $S0 = size
+    codestring .= $S0
+    codestring .= ";\n"
+    .return (codestring)
+
+  err_infile:
+    die "cannot open infile"
+.end
+
+# util functions
+.sub 'compile_file'
+    .param string cfile
+    .param string objfile
+    .param int install :optional
+
+    $P0 = '_config'()
+    .local string cc, ccflags, cc_o_out, osname, build_dir, slash
+    cc        = $P0['cc']
+    ccflags   = $P0['ccflags']
+    cc_o_out  = $P0['cc_o_out']
+    osname    = $P0['osname']
+    build_dir = $P0['build_dir']
+    slash     = $P0['slash']
+
+    .local string includedir, pathquote
+    includedir = concat build_dir, slash
+    includedir = concat includedir, 'include'
+    pathquote  = ''
+    unless osname == 'MSWin32' goto not_windows
+    pathquote  = '"'
+  not_windows:
+
+    .local string compile
+    compile  = cc
+    compile .= ' '
+    compile .= cc_o_out
+    compile .= objfile
+    compile .= ' -I'
+    compile .= pathquote
+    compile .= includedir
+    compile .= pathquote
+    compile .= ' '
+    compile .= ccflags
+    compile .= ' -c '
+    compile .= cfile
+
+    say compile
+    .local int status
+    status = spawnw compile
+    unless status goto compiled
+
+    die "compilation failed"
+
+  compiled:
+    print "Compiled: "
+    say objfile
+    .return()
+.end
+
+.sub 'link_file'
+    .param string objfile
+    .param string exefile
+    .param int install :optional
+
+    $P0 = '_config'()
+    .local string cc, link, link_dynamic, linkflags, ld_out, libparrot, libs, o
+    .local string rpath, osname, build_dir, slash, icushared
+    cc           = $P0['cc']
+    link         = $P0['link']
+    link_dynamic = $P0['link_dynamic']
+    linkflags    = $P0['linkflags']
+    ld_out       = $P0['ld_out']
+    libparrot    = $P0['libparrot_ldflags']
+    libs         = $P0['libs']
+    o            = $P0['o']
+    rpath        = $P0['rpath_blib']
+    osname       = $P0['osname']
+    build_dir    = $P0['build_dir']
+    slash        = $P0['slash']
+    icushared    = $P0['icu_shared']
+
+    .local string config, pathquote, exeprefix
+    exeprefix = substr exefile, 0, 12
+    config     = concat build_dir, slash
+    config    .= 'src'
+    config    .= slash
+    if exeprefix == 'installable_' goto config_install
+    config    .= 'parrot_config'
+    goto config_cont
+ config_install:
+    config    .= 'install_config'
+    rpath     = $P0['rpath_lib']
+ config_cont:
+    config    .= o
+    pathquote  = ''
+    unless osname == 'MSWin32' goto not_windows
+    pathquote  = '"'
+  not_windows:
+
+    link .= ' '
+    link .= ld_out
+    link .= exefile
+    link .= ' '
+    link .= pathquote
+    link .= objfile
+    link .= pathquote
+    link .= ' '
+    link .= config
+    link .= ' '
+    link .= rpath
+    link .= ' '
+    link .= libparrot
+    link .= ' '
+    link .= link_dynamic
+    link .= ' '
+    link .= linkflags
+    link .= ' '
+    link .= libs
+    link .= ' '
+    link .= icushared
+
+    say link
+    .local int status
+    status = spawnw link
+    unless status goto check_manifest
+
+    die "linking failed"
+
+  check_manifest:
+    # Check if there is a MSVC app manifest
+    .local pmc file
+    file = new 'File'
+    .local string manifest_file_name
+    manifest_file_name  = exefile
+    manifest_file_name .= '.manifest'
+    .local pmc manifest_exists
+    manifest_exists = file.'exists'( manifest_file_name )
+    unless manifest_exists goto linked
+
+  embed_manifest:
+    # MSVC app manifest exists, embed it
+    .local string embed_manifest
+    embed_manifest  = 'mt.exe -nologo -manifest '
+    embed_manifest .= manifest_file_name
+    embed_manifest .= ' -outputresource:'
+    embed_manifest .= exefile
+    embed_manifest .= ';1'
+
+    say embed_manifest
+    .local int embed_manifest_status
+    embed_manifest_status = spawnw embed_manifest
+    unless embed_manifest_status goto linked
+    die 'manifest embedding failed'
+
+  linked:
+    print "Linked: "
+    say exefile
+    .return()
+.end
+
+
+# Local Variables:
+#   mode: pir
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:

Deleted: branches/vtable_morph_change/tools/dev/pbc_to_exe_gen.pl
==============================================================================
--- branches/vtable_morph_change/tools/dev/pbc_to_exe_gen.pl	Tue Feb 10 02:09:33 2009	(r36516)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,479 +0,0 @@
-#! perl
-
-# Copyright (C) 2008, The Perl Foundation.
-# $Id$
-
-use strict;
-use warnings;
-
-print do { local $/; <DATA> };
-
-__END__
-#! parrot
-
-# DO NOT EDIT; your changes will be lost.
-# This file was generated automatically by tools/dev/pbc_to_exe_gen.pl
-
-=head1 TITLE
-
-pbc_to_exe
-
-=head2 SYNOPSIS
-
-  pbc_to_exe my.pbc
-  => my.exe
-
-  pbc_to_exe my.pbc --install
-  => installable_my.exe
-
-Warning! With -install there must be no directory prefix in the first arg yet.
-
-=cut
-
-.include 'library/config.pir'
-
-.sub 'main' :main
-    .param pmc    argv
-    .local string infile
-    .local string cfile
-    .local string objfile
-    .local string exefile
-    .local string out
-
-    (infile, cfile, objfile, exefile) = 'handle_args'(argv)
-    $I0                               = length infile
-    if $I0 goto open_outfile
-    die "infile not specified"
-
-  open_outfile:
-    .local pmc outfh
-    outfh = open cfile, 'w'
-    if outfh goto args_handled
-    die "infile not specified"
-
-  args_handled:
-    .local pmc data
-    data = 'generate_data'(infile)
-    out  = 'program_code'(data)
-    print outfh, out
-    close outfh
-
-    'compile_file'(cfile, objfile)
-    'link_file'(objfile, exefile)
-.end
-
-
-.sub 'handle_args'
-    .param pmc argv
-
-    .local pmc args
-    args   = argv
-
-    .local int argc
-    argc = args
-
-    if argc == 2 goto proper_args
-    if argc == 3 goto check_install
-    .return ()
-
-check_install:
-    .local string infile, install
-
-    $P0    = shift args
-    infile = shift args
-    install = shift args
-    if install == '--install' goto proper_install
-    .return ()
-
-proper_install:
-    .local string cfile, objfile, obj, exefile, exe
-
-    $P0    = '_config'()
-    obj    = $P0['o']
-    exe    = $P0['exe']
-
-    .local int infile_len
-    infile_len  = length infile
-    infile_len -= 3
-
-    cfile       = substr infile, 0, infile_len
-    cfile      .= 'c'
-
-    dec infile_len
-    objfile     = substr infile, 0, infile_len
-    exefile     = 'installable_'
-    exefile    .= objfile
-    exefile    .= exe
-    objfile    .= obj
-    .return(infile, cfile, objfile, exefile)
-
-proper_args:
-    .local string infile, cfile, objfile, obj, exefile, exe
-
-    $P0    = '_config'()
-    obj    = $P0['o']
-    exe    = $P0['exe']
-
-    $P0    = shift args
-    infile = shift args
-
-    .local int infile_len
-    infile_len  = length infile
-    infile_len -= 3
-
-    cfile       = substr infile, 0, infile_len
-    cfile      .= 'c'
-
-    dec infile_len
-    objfile     = substr infile, 0, infile_len
-    objfile    .= obj
-    exefile     = substr infile, 0, infile_len
-    exefile    .= exe
-
-    # substitute .c for .pbc
-    # remove .c for executable
-
-    # TODO this should complain about results/returns mismatch
-    .return(infile, cfile, objfile, exefile)
-.end
-
-
-.sub 'generate_data'
-    .param string infile
-
-    .local pmc infh
-               infh = open infile, 'r'
-
-    if infh goto file_open
-    die "cannot open infile"
-
-  file_open:
-    # read the file one opcode at a time -- for simplicity. optimize later
-    .local int buffer_size
-    $P0 = _config()
-    buffer_size = $P0['longsize']  # sizeof (opcode_t)
-
-    .local string bytecode
-                  bytecode = ''
-    .local int    size
-                  size = 0
-    .local pmc    data
-                  data = new 'Hash'
-    .local pmc    all_bytes
-                  all_bytes = new 'ResizablePMCArray'
-    .local int    at_eof
-    .local int    string_length
-    .local string byte_string
-    .local int    byte
-    .local int    bytes_per_line
-                  bytes_per_line=64
-
-
-  loop:
-    at_eof = infh.'eof'()
-    if at_eof goto end_loop
-
-    # read one byte at a time
-    byte_string = read infh, 1
-    string_length = length byte_string
-    unless string_length goto end_loop
-
-    # convert byte to integer
-    byte = ord byte_string
-    # convert integer to string
-    $S0 = byte
-    # add string for the byte
-    bytecode .= $S0
-    bytecode .= ','
-    size += 1
-    $I0 = size % bytes_per_line
-    if $I0 != 0 goto loop
-    bytecode .= "\n"
-    goto loop
-  end_loop:
-
-    data['BYTECODE'] = bytecode
-    data['SIZE']     = size
-
-    .return (data)
-.end
-
-
-.sub 'program_code'
-    .param pmc    data
-    .local string template, out
-
-    template = 'pc_template'()
-    out = 'merge_data'(template, data)
-
-    .return (out)
-.end
-
-
-# template data functions
-.sub 'pc_template'
-    .local string out
-
-    out = 'header'()
-
-    $S0 = <<'END_PC'
-const Parrot_UInt1 program_code[] = {
- at BYTECODE@
-};
-
-const int bytecode_size = @SIZE@;
-
-END_PC
-
-    out .= $S0
-    $S0  = 'body'()
-    out .= $S0
-
-    .return (out)
-.end
-
-
-.sub 'header'
-    $S0 = <<'END_HEADER'
-#include "parrot/parrot.h"
-#include "parrot/embed.h"
-
-END_HEADER
-    .return ($S0)
-.end
-
-
-.sub 'body'
-    $S0 = <<'END_BODY'
-int main(int argc, char *argv[])
-{
-    PackFile     *pf;
-    Parrot_Interp interp;
-
-    Parrot_set_config_hash();
-
-    interp = Parrot_new( NULL );
-
-    if (!interp)
-        return 1;
-
-    Parrot_set_executable_name(interp, Parrot_str_new(interp, argv[0], 0));
-    Parrot_set_flag(interp, PARROT_DESTROY_FLAG);
-
-    pf = PackFile_new(interp, 0);
-
-    if (!PackFile_unpack(interp, pf, (const opcode_t *)program_code, bytecode_size))
-        return 1;
-
-    do_sub_pragmas(interp, pf->cur_cs, PBC_PBC, NULL);
-
-    Parrot_loadbc(interp, pf);
-
-    PackFile_fixup_subs(interp, PBC_MAIN, NULL);
-    Parrot_runcode(interp, argc, argv);
-    Parrot_destroy(interp);
-    Parrot_exit(interp, 0);
-}
-END_BODY
-    .return ($S0)
-.end
-
-
-# template merging functions
-.sub 'merge_data'
-    .param string template
-    .param pmc    data
-
-    .local pmc    iter
-    iter = new 'Iterator', data
-
-    .local string symbol, value
-
-  it_loop:
-    unless iter goto it_done
-    $P0 = shift iter
-    symbol = 'get_symbol'($P0)
-    value  = iter[$P0]
-      repl_loop:
-        $I0 = index template, symbol
-        if -1 == $I0 goto repl_done
-        $I1 = length symbol
-        substr template, $I0, $I1, value
-        goto repl_loop
-      repl_done:
-    goto it_loop
-
-  it_done:
-    .return (template)
-.end
-
-
-.sub 'get_symbol'
-    .param string var
-    $S0 = '@'
-    $S1 = concat $S0, var
-    $S1 = concat $S1, $S0
-    .return ($S1)
-.end
-
-
-# util functions
-.sub 'compile_file'
-    .param string cfile
-    .param string objfile
-    .param int install :optional
-
-    $P0 = '_config'()
-    .local string cc, ccflags, cc_o_out, osname, build_dir, slash
-    cc        = $P0['cc']
-    ccflags   = $P0['ccflags']
-    cc_o_out  = $P0['cc_o_out']
-    osname    = $P0['osname']
-    build_dir = $P0['build_dir']
-    slash     = $P0['slash']
-
-    .local string includedir, pathquote
-    includedir = concat build_dir, slash
-    includedir = concat includedir, 'include'
-    pathquote  = ''
-    unless osname == 'MSWin32' goto not_windows
-    pathquote  = '"'
-  not_windows:
-
-    .local string compile
-    compile  = cc
-    compile .= ' '
-    compile .= cc_o_out
-    compile .= objfile
-    compile .= ' -I'
-    compile .= pathquote
-    compile .= includedir
-    compile .= pathquote
-    compile .= ' '
-    compile .= ccflags
-    compile .= ' -c '
-    compile .= cfile
-
-    say compile
-    .local int status
-    status = spawnw compile
-    unless status goto compiled
-
-    die "compilation failed"
-
-  compiled:
-    print "Compiled: "
-    say objfile
-    .return()
-.end
-
-.sub 'link_file'
-    .param string objfile
-    .param string exefile
-    .param int install :optional
-
-    $P0 = '_config'()
-    .local string cc, ld, link_dynamic, linkflags, ld_out, libparrot, libs, o
-    .local string rpath, osname, build_dir, slash, icushared
-    cc           = $P0['cc']
-    ld           = $P0['ld']
-    link_dynamic = $P0['link_dynamic']
-    linkflags    = $P0['linkflags']
-    ld_out       = $P0['ld_out']
-    libparrot    = $P0['libparrot_ldflags']
-    libs         = $P0['libs']
-    o            = $P0['o']
-    rpath        = $P0['rpath_blib']
-    osname       = $P0['osname']
-    build_dir    = $P0['build_dir']
-    slash        = $P0['slash']
-    icushared    = $P0['icu_shared']
-
-    .local string config, pathquote, exeprefix
-    exeprefix = substr exefile, 0, 12
-    config     = concat build_dir, slash
-    config    .= 'src'
-    config    .= slash
-    if exeprefix == 'installable_' goto config_install
-    config    .= 'parrot_config'
-    goto config_cont
- config_install:
-    config    .= 'install_config'
-    rpath     = $P0['rpath_lib']
- config_cont:
-    config    .= o
-    pathquote  = ''
-    unless osname == 'MSWin32' goto not_windows
-    pathquote  = '"'
-  not_windows:
-
-    .local string link
-    link  = ld
-    link .= ' '
-    link .= ld_out
-    link .= exefile
-    link .= ' '
-    link .= pathquote
-    link .= objfile
-    link .= pathquote
-    link .= ' '
-    link .= config
-    link .= ' '
-    link .= rpath
-    link .= ' '
-    link .= libparrot
-    link .= ' '
-    link .= link_dynamic
-    link .= ' '
-    link .= linkflags
-    link .= ' '
-    link .= libs
-    link .= ' '
-    link .= icushared
-
-    say link
-    .local int status
-    status = spawnw link
-    unless status goto check_manifest
-
-    die "linking failed"
-
-  check_manifest:
-    # Check if there is a MSVC app manifest
-    .local pmc file
-    file = new 'File'
-    .local string manifest_file_name
-    manifest_file_name  = exefile
-    manifest_file_name .= '.manifest'
-    .local pmc manifest_exists
-    manifest_exists = file.'exists'( manifest_file_name )
-    unless manifest_exists goto linked
-
-  embed_manifest:
-    # MSVC app manifest exists, embed it
-    .local string embed_manifest
-    embed_manifest  = 'mt.exe -nologo -manifest '
-    embed_manifest .= manifest_file_name
-    embed_manifest .= ' -outputresource:'
-    embed_manifest .= exefile
-    embed_manifest .= ';1'
-
-    say embed_manifest
-    .local int embed_manifest_status
-    embed_manifest_status = spawnw embed_manifest
-    unless embed_manifest_status goto linked
-    die 'manifest embedding failed'
-
-  linked:
-    print "Linked: "
-    say exefile
-    .return()
-.end
-
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: branches/vtable_morph_change/tools/install/smoke.pl
==============================================================================
--- branches/vtable_morph_change/tools/install/smoke.pl	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/tools/install/smoke.pl	Tue Feb 10 02:09:33 2009	(r36517)
@@ -80,9 +80,9 @@
 $out = `$exe`;
 ok($out =~ /^pbc_merge/, "check pbc_merge");
 
-$exe = catfile($bindir, 'pdump');
+$exe = catfile($bindir, 'pbc_dump');
 $out = `$exe`;
-ok($out =~ /^pdump/, "check pdump");
+ok($out =~ /^pbc_dump/, "check pbc_dump");
 
 ok(system("$parrot -V") == 0, "display parrot version");
 

Modified: branches/vtable_morph_change/tools/util/pgegrep
==============================================================================
--- branches/vtable_morph_change/tools/util/pgegrep	Tue Feb 10 02:09:09 2009	(r36516)
+++ branches/vtable_morph_change/tools/util/pgegrep	Tue Feb 10 02:09:33 2009	(r36517)
@@ -185,9 +185,12 @@
 
 	end
 handler:
-	.local pmc exception
+	.local pmc exception, pmcmsg
 	.local string message
-	.get_results (exception, message)
+	.get_results (exception)
+	pmcmsg = getattribute exception, 'message'
+	pop_eh
+        message = pmcmsg
         message  = "pgegrep: " . message
         die message
 .end


More information about the parrot-commits mailing list